<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.community-credit.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'silverlight' and 'LINQ'</title><link>http://www.community-credit.com/cs/search/SearchResults.aspx?o=DateDescending&amp;tag=silverlight,LINQ&amp;orTags=0</link><description>Search results matching tags 'silverlight' and 'LINQ'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Can XAML be modified via LINQ?</title><link>http://www.community-credit.com/cs/forums/p/2241/5294.aspx#5294</link><pubDate>Tue, 19 Aug 2008 17:21:11 GMT</pubDate><guid isPermaLink="false">dc2d8ed1-db5f-43a8-9632-42f90caf747d:5294</guid><dc:creator>ArdMan</dc:creator><description>&lt;p&gt;&lt;b&gt;XAML:&lt;/b&gt; A canvas, I have a few buttons and rectangles.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Challenge:&lt;/b&gt; Remove the rectangles from the Canvas using only their types, but leaving the existing buttons alone.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;Thoughts:&lt;/b&gt; I&amp;#39;ve wondered if this is possible with LINQ, but I&amp;#39;m stupid green to LINQ.&amp;nbsp; I have seen LINQ used to query an SQL database and XML, but I&amp;#39;ve never seen an example of it tweaking XAML objects.&amp;nbsp; I&amp;#39;m thinking it&amp;#39;s theorically possible. &lt;/p&gt;&lt;p&gt;&lt;b&gt;Discoveries:&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve discovered:&lt;/p&gt;&lt;p&gt;1. I can loop through all of the elements in a Canvas by referencing its &amp;quot;Children&amp;quot;.&amp;nbsp;&lt;/p&gt;&lt;p&gt;2. I can use the &amp;quot;GetType&amp;quot; method to find an element&amp;#39;s type. &lt;/p&gt;&lt;p&gt;3. Calling the &amp;quot;Remove&amp;quot; method of a Canvas inside of a foreach loop throws the program into an error. &lt;/p&gt;</description></item></channel></rss>