<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/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>Installation and Setup</title><link>http://forums.silverlight.net/forums/13.aspx</link><description>All about installing and getting Silverlight running on your system</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: How to find control by type??</title><link>http://forums.silverlight.net/forums/thread/234350.aspx</link><pubDate>Wed, 17 Jun 2009 06:53:50 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:234350</guid><dc:creator>addanki</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/234350.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=13&amp;PostID=234350</wfw:commentRss><description>&lt;p&gt;&lt;font color="#0000ff"&gt;I got my mistake..&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;Thanks &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;Ashok&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: How to find control by type??</title><link>http://forums.silverlight.net/forums/thread/234342.aspx</link><pubDate>Wed, 17 Jun 2009 06:30:27 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:234342</guid><dc:creator>addanki</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/234342.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=13&amp;PostID=234342</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your quick reply.&lt;/p&gt;
&lt;p&gt;I am able retrieve the descendents, but, after adding to the page, only button is visible, but the rest of the controls like TextBlock, TextBox which are there inside the XAML string are not visible?&lt;/p&gt;
&lt;p&gt;Any idea what might be the mistake??&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to find control by type??</title><link>http://forums.silverlight.net/forums/thread/234328.aspx</link><pubDate>Wed, 17 Jun 2009 05:27:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:234328</guid><dc:creator>ksleung</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/234328.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=13&amp;PostID=234328</wfw:commentRss><description>&lt;p&gt;Don&amp;#39;t know if there is a shorter answer but you can use VisualTreeHelper to (recursively) traverse the descendents of the user control, and test whether a descendent control is a Button...&lt;/p&gt;&lt;p&gt;&lt;font face="courier new,courier"&gt;if (control is Button) { do_something(control); }&lt;/font&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to find control by type??</title><link>http://forums.silverlight.net/forums/thread/234321.aspx</link><pubDate>Wed, 17 Jun 2009 05:19:39 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:234321</guid><dc:creator>addanki</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/234321.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=13&amp;PostID=234321</wfw:commentRss><description>&lt;p&gt;It is possible to find the control by name, as below.&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;UserControl&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; ctrl = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UserControl&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;)System.Windows.Markup.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XamlReader&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;.Load(str);&lt;/font&gt;&lt;/font&gt;&amp;nbsp;// str contains some usercontrol xaml &lt;/p&gt;
&lt;p&gt;Button&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; button = ctrl.FindName(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;ID&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;as&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Button&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;My problem is, is it possible to find the control by type??&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Button btn = ctrl.FindControl(&amp;quot;Button&amp;quot;) as Button;&lt;/p&gt;
&lt;p&gt;if more than one button&amp;nbsp;control is there, then it should return the ButtonList or it should be possible to set the starting index to search for the control.&lt;/p&gt;
&lt;p&gt;Please let me know the approach to do in the above manner?&lt;/p&gt;</description></item></channel></rss>