<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Silverlight 2 (beta1): User Control Inheritance</title>
	<atom:link href="http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance</link>
	<description>Sharing our knowledge</description>
	<pubDate>Tue, 06 Jan 2009 15:27:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>By: Back on the SilverTrader road &#171; Tales from a Trading Desk</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-122173</link>
		<dc:creator>Back on the SilverTrader road &#171; Tales from a Trading Desk</dc:creator>
		<pubDate>Mon, 17 Nov 2008 06:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-122173</guid>
		<description>[...] problems I hit were ControlBase Silverlight 1.1 dependencies (UserControl inheritance problems - resolved by creating the custom controls again), and VS 2008 getting confused with [...]</description>
		<content:encoded><![CDATA[<p>[...] problems I hit were ControlBase Silverlight 1.1 dependencies (UserControl inheritance problems - resolved by creating the custom controls again), and VS 2008 getting confused with [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berni</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-117098</link>
		<dc:creator>Berni</dc:creator>
		<pubDate>Sun, 26 Oct 2008 17:01:24 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-117098</guid>
		<description>I have this same thing happening, in Silverlight RC1.
Is there a new fix??</description>
		<content:encoded><![CDATA[<p>I have this same thing happening, in Silverlight RC1.<br />
Is there a new fix??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CSH</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-115301</link>
		<dc:creator>CSH</dc:creator>
		<pubDate>Thu, 16 Oct 2008 17:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-115301</guid>
		<description>I downloaded your project, ran it straight from the box, and received this error:  Unknown element:  BaseControl.

In the InheritedControl designer, the BaseControl tag is not recognized.</description>
		<content:encoded><![CDATA[<p>I downloaded your project, ran it straight from the box, and received this error:  Unknown element:  BaseControl.</p>
<p>In the InheritedControl designer, the BaseControl tag is not recognized.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63235</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Fri, 16 May 2008 07:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63235</guid>
		<description>&lt;blockquote&gt;did think I read something somewhere in the Silverlight forms that you could add Controls dynamically to the base class (but there was no example).&lt;/blockquote&gt;

Can you please give me the link? Normally, I used to read the most of messages in Silverlight forum.. 

&lt;blockquote&gt;The reason why is because I want to extend the functionality of my UserControl. 
&lt;/blockquote&gt;

As you already know, we can't add XAML in base control. This is the main thing. 

Example #1: 

Let's say you have created one base class that has a function called validatedUser(string,string). Then, you create another class that inherits from base class and you can comsume that functionality. then, it's possible to do in Silverlight.. 

Example #2: 

Let's say you have created one base class that has a button. (You can't have XAML so that it won't show on Designer anyway.) then, you create another class that inherit from that base class.. but the button that you created in Base control won't be shown. that's why I'm wondering why you need to do that.. 

&lt;blockquote&gt;
I have create BaseControl in a silverlight class library,then create a User Control Inheritance from BaseControl ,but the user control is in other project(a silverlight application) who reference to this class library,then we i build the project,VS modify the usercontrol.g.cs change the baseControl back to UserControl…
&lt;/blockquote&gt;

Please check two things

1) 
&lt;BaseControl x:Class="SL2Controls.InheritedControl"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300"&gt;
&lt;Grid x:Name="LayoutRoot" Background="Red"&gt;

&lt;/Grid&gt;
&lt;/BaseControl&gt;

You should use BaseControl instead of User Control. 

2) public partial class InheritedControl : BaseControl { 

Your class should be inherited from BaseControl.</description>
		<content:encoded><![CDATA[<blockquote><p>did think I read something somewhere in the Silverlight forms that you could add Controls dynamically to the base class (but there was no example).</p></blockquote>
<p>Can you please give me the link? Normally, I used to read the most of messages in Silverlight forum.. </p>
<blockquote><p>The reason why is because I want to extend the functionality of my UserControl.
</p></blockquote>
<p>As you already know, we can&#8217;t add XAML in base control. This is the main thing. </p>
<p>Example #1: </p>
<p>Let&#8217;s say you have created one base class that has a function called validatedUser(string,string). Then, you create another class that inherits from base class and you can comsume that functionality. then, it&#8217;s possible to do in Silverlight.. </p>
<p>Example #2: </p>
<p>Let&#8217;s say you have created one base class that has a button. (You can&#8217;t have XAML so that it won&#8217;t show on Designer anyway.) then, you create another class that inherit from that base class.. but the button that you created in Base control won&#8217;t be shown. that&#8217;s why I&#8217;m wondering why you need to do that.. </p>
<blockquote><p>
I have create BaseControl in a silverlight class library,then create a User Control Inheritance from BaseControl ,but the user control is in other project(a silverlight application) who reference to this class library,then we i build the project,VS modify the usercontrol.g.cs change the baseControl back to UserControl…
</p></blockquote>
<p>Please check two things</p>
<p>1)<br />
<basecontrol x:Class="SL2Controls.InheritedControl"<br />
xmlns="http://schemas.microsoft.com/client/2007"<br />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
Width="400" Height="300"><br />
<grid x:Name="LayoutRoot" Background="Red"></p>
<p></grid><br />
</basecontrol></p>
<p>You should use BaseControl instead of User Control. </p>
<p>2) public partial class InheritedControl : BaseControl { </p>
<p>Your class should be inherited from BaseControl.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allan</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63233</link>
		<dc:creator>Allan</dc:creator>
		<pubDate>Fri, 16 May 2008 07:28:01 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63233</guid>
		<description>hi,i have same question,

I have create BaseControl in a silverlight class library,then create a User Control Inheritance from BaseControl ,but the user control is in other project(a silverlight application) who reference to this class library,then we i build the project,VS modify the usercontrol.g.cs change the baseControl back to UserControl...</description>
		<content:encoded><![CDATA[<p>hi,i have same question,</p>
<p>I have create BaseControl in a silverlight class library,then create a User Control Inheritance from BaseControl ,but the user control is in other project(a silverlight application) who reference to this class library,then we i build the project,VS modify the usercontrol.g.cs change the baseControl back to UserControl&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fraser</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63112</link>
		<dc:creator>Fraser</dc:creator>
		<pubDate>Thu, 15 May 2008 18:18:37 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63112</guid>
		<description>I knew that you couldn't have a XAML file attached to the base class but I did think I read something somewhere in the Silverlight forms that you could add Controls dynamically to the base class (but there was no example). 

The reason why is because I want to extend the functionality of my UserControl.  I've created a Silverlight application that has a UserControl that has a bunch of child custom UserControls and it does a bunch of things.  I now want to create administration functionality for my application and take that base UserControl and add more functionality and child UserControls to it.
I can't just re-write the UserControl, because the child UserControls depend on the parent being of a specific type with some menthods.  So if I re-write one I have to re-write them all and then I have a lot of duplicated code.</description>
		<content:encoded><![CDATA[<p>I knew that you couldn&#8217;t have a XAML file attached to the base class but I did think I read something somewhere in the Silverlight forms that you could add Controls dynamically to the base class (but there was no example). </p>
<p>The reason why is because I want to extend the functionality of my UserControl.  I&#8217;ve created a Silverlight application that has a UserControl that has a bunch of child custom UserControls and it does a bunch of things.  I now want to create administration functionality for my application and take that base UserControl and add more functionality and child UserControls to it.<br />
I can&#8217;t just re-write the UserControl, because the child UserControls depend on the parent being of a specific type with some menthods.  So if I re-write one I have to re-write them all and then I have a lot of duplicated code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63102</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Thu, 15 May 2008 17:23:27 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63102</guid>
		<description>Why do you want to add the controls dynamically to the base class? As you know, there is no XAML in base class.. so, your control won't be shown anyways..</description>
		<content:encoded><![CDATA[<p>Why do you want to add the controls dynamically to the base class? As you know, there is no XAML in base class.. so, your control won&#8217;t be shown anyways..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fraser</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63094</link>
		<dc:creator>Fraser</dc:creator>
		<pubDate>Thu, 15 May 2008 16:52:44 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-63094</guid>
		<description>Excellent post, very helpful.

However I have one more question, how can I add the controls dynamically in the base class (BaseControl)?

There isn't a this.Children.Add() as it's a UserControl and I get a null value when I call Application.Current.RootVisual

What am I missing?

Thanks</description>
		<content:encoded><![CDATA[<p>Excellent post, very helpful.</p>
<p>However I have one more question, how can I add the controls dynamically in the base class (BaseControl)?</p>
<p>There isn&#8217;t a this.Children.Add() as it&#8217;s a UserControl and I get a null value when I call Application.Current.RootVisual</p>
<p>What am I missing?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-57934</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Sun, 27 Apr 2008 05:56:18 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-57934</guid>
		<description>One interesting problem.. http://silverlight.net/forums/t/14936.aspx</description>
		<content:encoded><![CDATA[<p>One interesting problem.. <a href="http://silverlight.net/forums/t/14936.aspx" rel="nofollow">http://silverlight.net/forums/t/14936.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sync</title>
		<link>http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-56921</link>
		<dc:creator>Michael Sync</dc:creator>
		<pubDate>Tue, 22 Apr 2008 15:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance#comment-56921</guid>
		<description>Hello Necroman, 

I need to see the XAML for ControlTwo. Okay.. I will come to forum..</description>
		<content:encoded><![CDATA[<p>Hello Necroman, </p>
<p>I need to see the XAML for ControlTwo. Okay.. I will come to forum..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
