<?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>Silverlight Controls and Silverlight Toolkit</title><link>http://forums.silverlight.net/forums/35.aspx</link><description>Discussions around using and developing Silverlight controls and the Silverlight Toolkit</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Re: Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/106916.aspx</link><pubDate>Sun, 12 Oct 2008 11:06:10 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:106916</guid><dc:creator>Rincewind60</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/106916.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=106916</wfw:commentRss><description>&lt;p&gt;I have only just started learning SilverLight and already I find the need to be able to&amp;nbsp;create a control with dynamic xaml.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So Microsoft.&lt;/p&gt;
&lt;p&gt;How do we create a control where the XAML is coming from the server and contains names and event handlers?&lt;/p&gt;
&lt;p&gt;What is the solution...&lt;/p&gt;
&lt;p&gt;(Based on the number of views for this thread I guess I&amp;#39;m not alone!)&lt;/p&gt;</description></item><item><title>Re: Re: Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/105538.aspx</link><pubDate>Thu, 09 Oct 2008 14:59:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:105538</guid><dc:creator>ninomk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/105538.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=105538</wfw:commentRss><description>&lt;p&gt;In Silverlight RC0 I want to create DataTemplate for a control generated dynamically and register some events to it. LoadComponent is bad solution because I need a lot of instances of this control and would like to cache the XAML string (not to read from resource file each time). Therefore I think Microsoft should provide an overload for LoadComponent that will accept string as argument or return back the InitializeFromXAML method in the final release.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/81671.aspx</link><pubDate>Mon, 18 Aug 2008 21:53:26 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:81671</guid><dc:creator>udithanda</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/81671.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=81671</wfw:commentRss><description>&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;This is real setback we definitely need this function back. In my scenario I need users to drag and drop 3rd party controls on a designer that can be loaded dynamically. So no&amp;nbsp;tweaking would work &lt;img src="http://silverlight.net/emoticons/emotion-6.gif" alt="Sad" /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/78734.aspx</link><pubDate>Fri, 08 Aug 2008 00:48:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:78734</guid><dc:creator>AngleBracket</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/78734.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=78734</wfw:commentRss><description>&lt;p&gt;Can someone please explain to me how Application.LoadComponent API work?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have Page.xaml.cs class and in its constructor &amp;nbsp;i&amp;#39;m trying to load another Xaml (say MyControl.xaml) that i have in the same project. I was using XamlReader.Load to load MyControl.xaml. Then&amp;nbsp; i use the returned root element and add it as child of one of the Canvas defined in my Page.xaml.&lt;/p&gt;
&lt;p&gt;Well life is good so far... it displays the content. However i want to do a bit more complicated stuff - i.e add event handlers on&amp;nbsp;a&amp;nbsp;Button control defined in the MyControl.xaml. Yes the button has x:Name defined.&lt;/p&gt;
&lt;p&gt;Well i got the parser error at runtime, thats when i hit upon this post.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;So i go back to my constructor and change&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;ScrollViewer&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; pScroll = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ScrollViewer&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;XamlReader&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Load(uriString);&amp;nbsp;&amp;nbsp; to&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;Application&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.LoadComponent(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&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;new&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;Uri&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(fileName, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UriKind&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Relative));&lt;/font&gt;&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;Grid&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; content = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Grid&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;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Content;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;Here the fileName is the uri to MyControl.xaml and &amp;quot;this&amp;quot; refers to Page.xaml? &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;this.Content; gives the root of the Page.xaml? How can i get hold of the root of&amp;nbsp; MyControl.xaml?&lt;/p&gt;
&lt;p&gt;I want to get hold of the root element in MyControl.xaml so that i can add it as child of a Canvas in the main page (Page.xaml).&lt;/p&gt;i got null when i did &lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;Scrollbar &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;myScroll = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Canvas&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)content.FindName(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;myScrollBar&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;); &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;So can someone tell me what is going on here... &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Does&amp;nbsp;&lt;font color="#2b91af"&gt; &lt;/font&gt;Application&lt;font size="2"&gt;.LoadComponent(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&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;new&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;Uri&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(fileName, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;UriKind&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Relative));&amp;nbsp; create a tree structure of&amp;nbsp; the main page without the nodes from loaded xaml?&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;Similarly what does&amp;nbsp;&lt;font color="#2b91af"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;Application&lt;font size="2"&gt;.LoadComponent(url&lt;/font&gt;&lt;font size="2"&gt;) do?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your patience.&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/69228.aspx</link><pubDate>Tue, 08 Jul 2008 14:46:18 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:69228</guid><dc:creator>Raguvind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/69228.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=69228</wfw:commentRss><description>&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Hi,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;I have a scenario where I want to load a Datatemplate dynamically.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;In Silverlight 2 Beta 1 I used the InitializeFromXaml method to load the Datatemple. The reason for doing this is because the item inside the template had an event and the binding path is variable. In the runtime I am constructing the string that represents the Datatemplate. In this string the Binding path can change. &lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:blue;"&gt;string&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; dynamicTemplate = &lt;span style="COLOR:#a31515;"&gt;&amp;quot;&amp;lt;DataTemplate x:Key=\&amp;quot;newTemplate\&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt; +&lt;/span&gt;&lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#a31515;"&gt;&amp;quot;&amp;lt;TextBox xmlns=\&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation\&amp;quot; xmlns:x=\&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml\&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; +&lt;/span&gt;&lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#a31515;"&gt;&amp;quot;Text=\&amp;quot;test\&amp;quot; TextChanged=\&amp;quot;TextBox_TextChanged\&amp;quot; Text={Binding Name}/&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; +&lt;/span&gt;&lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#a31515;"&gt;&amp;quot;&amp;lt;/DataTemplate&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt;;&lt;/span&gt;&lt;/font&gt; 
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;In Silverlight 2 Beta 2 how can I do the same or can I load a datatemplate dynamicaly in the C# code.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Regards&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Ragu&lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/67240.aspx</link><pubDate>Wed, 02 Jul 2008 06:53:58 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:67240</guid><dc:creator>micmit</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/67240.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=67240</wfw:commentRss><description>&lt;p&gt;Is release of&amp;nbsp; the source code of that financial application working in Silverlight 2 Beta 2 supposed to be announced somewhere ? Or the only way to check&amp;nbsp; &lt;a href="http://www.financialdevelopers.com/"&gt;http://www.financialdevelopers.com&lt;/a&gt; from time to time ?&amp;nbsp; It is interesting, if it works at &lt;a href="http://www.cookingwithxaml.com/meals/financials/default.html"&gt;http://www.cookingwithxaml.com/meals/financials/default.html&lt;/a&gt; was new version just a hack which can&amp;#39;t be released as an example of proper replacement InitializeFromXaml or it was just forgotten.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/63827.aspx</link><pubDate>Sun, 22 Jun 2008 00:01:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:63827</guid><dc:creator>samcov</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/63827.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=63827</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/silverlight/images/icon-quote.gif"&gt; &lt;strong&gt;Tracie Everhart:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;I found the link to the financial services demo that gave us the examples of loading dynamic xaml strings in this manner. Your group posted this example using Silverlight 2 (Beta 1).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.financialdevelopers.com/"&gt;http://www.financialdevelopers.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download the Silverlight2 (Beta 1) Retail Financial Services Demonstrator located half-way down on this page. If you look at the Aspect.cs class in the Controls directory under BankingDemo, you can see an example of how I am using the InitializeFromXaml. They use this class to load embedded resources under the Aspects folder. &lt;/p&gt;
&lt;p&gt;Tracie&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;They have &lt;strong&gt;converted that application to Beta 2&lt;/strong&gt;, but have not released the source code.&lt;/p&gt;
&lt;p&gt;You can see it here - &lt;a href="http://www.cookingwithxaml.com/meals/financials/default.html"&gt;http://www.cookingwithxaml.com/meals/financials/default.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It will be interesting to see how they got around the loss of InitializeFromXaml.&lt;/p&gt;
&lt;p&gt;Sam...&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62549.aspx</link><pubDate>Wed, 18 Jun 2008 16:35:13 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62549</guid><dc:creator>c007</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62549.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62549</wfw:commentRss><description>&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;First of all, thank you so much for your answers and support!&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been using InitializeFromXaml() in the exact same way as Rajeev and Tracie.&lt;/p&gt;
&lt;p&gt;Furthermore, I&amp;#39;m mostly interested in creating an instance of a control from a XAML string&amp;nbsp;and then manipulate the instance as I would when creating any UserControl or object entirely from C#.&amp;nbsp; In this way, I add an arbitrary &amp;quot;object&amp;quot; to the container (canvas, grid, etc) instead of just a mere&amp;nbsp;Panel (or whatever the root element is cast as) to a tree.&lt;/p&gt;
&lt;p&gt;With the workarounds, I&amp;nbsp;solved the namescope issues and the event handling wiring.&amp;nbsp; My problem is that&amp;nbsp;I lost the ability to manipulate the dynamically created control because the instance is disconnected from the XAML object that&amp;nbsp;was injected into the tree.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m missing something?&amp;nbsp;&amp;nbsp;Please let me know.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62459.aspx</link><pubDate>Wed, 18 Jun 2008 13:30:45 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62459</guid><dc:creator>Tracie Everhart</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62459.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62459</wfw:commentRss><description>&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;I found the link to the financial services demo that gave us the examples of loading dynamic xaml strings in this manner. Your group posted this example using Silverlight 2 (Beta 1).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.financialdevelopers.com/"&gt;http://www.financialdevelopers.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Download the Silverlight2 (Beta 1) Retail Financial Services Demonstrator located half-way down on this page. If you look at the Aspect.cs class in the Controls directory under BankingDemo, you can see an example of how I am using the InitializeFromXaml. They use this class to load embedded resources under the Aspects folder. &lt;/p&gt;
&lt;p&gt;Tracie&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62433.aspx</link><pubDate>Wed, 18 Jun 2008 12:32:53 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62433</guid><dc:creator>Tracie Everhart</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62433.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62433</wfw:commentRss><description>&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;Rajeev is&amp;nbsp;describing exactly&amp;nbsp;how I am using the InitializeFromXaml() method. In my app, I have many individual xaml files in a folder (as my wrappers) that were marked as embedded resource strings, each with the appropriate event hookups, etc. Then, I had&amp;nbsp;one common control source file with all the event handlers that loaded a string as dynamic xaml during the contructor.&amp;nbsp;This was so powerful! I was able to create different xaml icons for navigation and hook unique animations and outlines of the different icons based on mouse events, all controled with one nice source file with all the events.&lt;/p&gt;
&lt;p&gt;The problem I have with your workaround above is that you still have only one xaml file hooked to each class definition. I have tried many alternative solutions, but I keep getting&amp;nbsp;parser errors&amp;nbsp;when I call LoadComponent() on anything other than loading the xaml defined with that class name.&lt;/p&gt;
&lt;p&gt;I will be glad to put together a sample app if needed.&lt;/p&gt;
&lt;p&gt;Tracie&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62227.aspx</link><pubDate>Tue, 17 Jun 2008 23:06:09 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62227</guid><dc:creator>RajeevGoel</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62227.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62227</wfw:commentRss><description>&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try to give as much info as I can about what I need for my scenario, but I&amp;#39;d rather not&amp;nbsp;reveal the nature of the app I&amp;#39;m building on the forum.&amp;nbsp; In my case, I have a class that derives from UserControl&amp;nbsp;that has already been compiled into a DLL, and this DLL is part of my Silverlight application.&amp;nbsp; This class contains event handlers.&amp;nbsp; The class has a special constructor that&amp;nbsp;takes a string parameter as input, which is the xaml itself.&amp;nbsp; The constructor then&amp;nbsp;calls &amp;quot;this.InitializeFromXaml(string)&amp;quot; (in Beta 1), passing in that same string.&amp;nbsp; This constructor does &lt;em&gt;not&lt;/em&gt; call InitializeComponent; in fact, no such method exists in my case.&amp;nbsp; The XAML string that is passed into the constructor is authored by a human (i.e., it is not computer-generated), but not necessarily a trusted human.&amp;nbsp; The XAML will contain event hookups that refer to the event handler methods that are already part of the class.&amp;nbsp; I need to instantiante several instances of this class using different XAML content each time.&amp;nbsp; If the XAML refers to an event handler that doesn&amp;#39;t exist on the class, it&amp;#39;s an error.&lt;/p&gt;
&lt;p&gt;If this is not enough info, we can perhaps talk offline.&lt;/p&gt;
&lt;p&gt;--Rajeev&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62223.aspx</link><pubDate>Tue, 17 Jun 2008 22:42:39 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62223</guid><dc:creator>Nick Kramer</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62223.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62223</wfw:commentRss><description>&lt;p&gt;Some thoughts about a workaround -- if you have a little bit of flexibility about what the xaml looks like, you can stuff event handling information into the Tag property, and do a tree walk after XamlReader.Load() to hook up the events.&amp;nbsp; E.g.:&lt;/p&gt;
&lt;p&gt;&amp;lt;UserControl x:Class=&amp;quot;XamlReaderWithEvents.Page&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns=&amp;quot;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/a&gt;&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x=&amp;quot;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Width=&amp;quot;400&amp;quot; Height=&amp;quot;300&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid x:Name=&amp;quot;LayoutRoot&amp;quot; Background=&amp;quot;White&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;Button x:Name=&amp;quot;b&amp;quot; Tag=&amp;quot;MouseEnter=Page_MouseEnter;Click=Page_Click&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/Grid&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;/p&gt;
&lt;p&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;using System.Windows.Controls.Primitives;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.Reflection;&lt;/p&gt;
&lt;p&gt;namespace XamlReaderWithEvents {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public partial class Page : UserControl {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Page() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree(LayoutRoot, HookUpEventsFromTag);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HookUpEventsFromTag(FrameworkElement element) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Object objectWithHandlers = this;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type typeWithHandlers = objectWithHandlers.GetType();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (element.Tag != null &amp;amp;&amp;amp; element.Tag is string) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var tag = (string)element.Tag;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var parts = tag.Split(new char[] { &amp;#39;;&amp;#39; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (string part in parts) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var subparts = part.Split(new char[] { &amp;#39;=&amp;#39; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(subparts.Length == 2);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var eventname = subparts[0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var methodname = subparts[1];&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var eventInfo = element.GetType().GetEvent(eventname, BindingFlags.Instance | BindingFlags.Public);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(eventInfo != null);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MethodInfo methodInfo = typeWithHandlers.GetMethod(methodname, BindingFlags.Instance | BindingFlags.Public);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(methodInfo != null);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var methodDelegate = Delegate.CreateDelegate(eventInfo.EventHandlerType, objectWithHandlers, methodInfo);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eventInfo.AddEventHandler(element, methodDelegate);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static void WalkTree(FrameworkElement element, Action&amp;lt;FrameworkElement&amp;gt; action) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; action(element);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (element is Panel) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var child in ((Panel)element).Children) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree((FrameworkElement)child, action);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (element is ContentControl) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var contentcontrol = (ContentControl)element;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (contentcontrol.Content is FrameworkElement) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree((FrameworkElement)contentcontrol.Content, action);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (element is ItemsControl) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var itemscontrol = (ItemsControl)element;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (object child in itemscontrol.Items) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (child is FrameworkElement) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree((FrameworkElement)child, action);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (element is Border) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var border = (Border)element;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree((FrameworkElement)border.Child, action);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (element is Popup) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var popup = (Popup)element;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WalkTree((FrameworkElement)popup.Child, action);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Page_MouseEnter(object sender, MouseEventArgs e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Page_Click(object sender, RoutedEventArgs e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;-Nick Kramer&lt;br /&gt;Senior Program Manager, Silverlight&lt;/p&gt;</description></item><item><title>Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/62222.aspx</link><pubDate>Tue, 17 Jun 2008 22:37:11 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:62222</guid><dc:creator>Nick Kramer</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/62222.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=62222</wfw:commentRss><description>&lt;p&gt;To give some context -- when I introduced InitializeFromXaml in the 1.1 alpha, I meant it as a placeholder mechanism until we could figure out the right way to load xaml for user controls. For beta one, we created UserControl/InitializeComponent, and control templates, and between those covered all the scenarios we had originally created InitializeFromXaml for. Its original purpose gone, I decided to remove it -- in Silverlight, the motto is when in doubt remove it, because that&amp;#39;s how we keep download size small. (As well as small documentation, small test costs, small number of bugs, etc.) We meant to pull InitializeFromXaml for beta 1, but ran out of time before MIX. We should have marked it obsolete, but we didn&amp;#39;t -- I apologize. &lt;/p&gt;
&lt;p&gt;Rajeev, c007 -- could you help me understand the scenario you&amp;#39;re trying to build with InitializeFromXaml? Are you generating the xaml on the server? What kinds of events are you hooking up, what methods are you looking them to come and what elements are you doing this on? Is the xaml generation under your control, or is it third-party xaml you&amp;#39;re merely storing away? Is the xaml trusted, or could it be compromised by an attacker? Does the xaml have to be editable by Blend? &lt;/p&gt;
&lt;p&gt;Tracie -- do control templates work for your skinning scenario? &lt;/p&gt;
&lt;p&gt;Again, I&amp;#39;d love to know more about what you&amp;#39;re trying to build. If e-mail or phone works better for you, please contact me at nkramer@Microsoft.com. Thanks. &lt;/p&gt;
&lt;p&gt;-Nick Kramer&lt;br /&gt;Senior Program Manager, Silverlight&lt;/p&gt;</description></item><item><title>Re: Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/61192.aspx</link><pubDate>Sat, 14 Jun 2008 15:12:11 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:61192</guid><dc:creator>c007</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/61192.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=61192</wfw:commentRss><description>&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;InitializeFromXaml() was a very powerful method.&amp;nbsp; Without it, there&amp;#39;s no clean way to store a control&amp;#39;s XAML in a database or in memory.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Can you guys at Microsoft put that method&amp;nbsp;back in the next release or patch, please?&amp;nbsp; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;An overload of Control.LoadComponent() as in Control.LoadComponent(string myActualXamlString) would work fine.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Again, I have to refactor (but have no idea how) an entire application that was working really well using that function.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Thanks!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: What happened to Control.InitializeFromXaml?</title><link>http://forums.silverlight.net/forums/thread/61009.aspx</link><pubDate>Fri, 13 Jun 2008 18:23:01 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:61009</guid><dc:creator>Tracie Everhart</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/61009.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=61009</wfw:commentRss><description>&lt;p&gt;I would like to vent some frustration too....&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been working on an application where I had created a custom control with different skins using embedded xaml resources. By using InitializeFromXaml, I was able to have one common control file that handled all my events, but could create different skins by passing in a string name of the embedded&amp;nbsp;xaml during the constructor to be hooked dynamically for each instance of my custom control. The LoadComponent does not allow this and none of your alternative solutions work!!! Am I missing something or did Microsoft truly take away a powerful feature of Silverlight!&lt;/p&gt;
&lt;p&gt;If I have to spend all of this energy re-wiring all the xaml names and event handlers, what&amp;#39;s the point???? I might as well create a custom user control for each skin or wrapper.&lt;/p&gt;</description></item></channel></rss>