<?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: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/83219.aspx</link><pubDate>Sat, 23 Aug 2008 20:38:44 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:83219</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/83219.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=83219</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Okay. I got it. &lt;/p&gt;&lt;p&gt;Please check-out the completed code from this link.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://silverlight.net/forums/p/23213/83217.aspx#83217"&gt;http://silverlight.net/forums/p/23213/83217.aspx#83217&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/83178.aspx</link><pubDate>Sat, 23 Aug 2008 16:07:43 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:83178</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/83178.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=83178</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;snyhol:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; Instead of editing the generated file (step #4), add a reference to the clr-namespace, and then&amp;nbsp;use this namespace in the Resources.&amp;nbsp;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It doesn&amp;#39;t work. If you close all file before re-building the application, you won&amp;#39;t get any error. but if you open that XAML file and re-build, you will get 3 errors.&amp;nbsp;&lt;/p&gt;Warning&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;The tag &amp;#39;Class1&amp;#39; does not exist in XML namespace &amp;#39;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;#39;.&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\Michael Sync\MyTechRoom\Silverlight\SL2Beta2\TestApp\TestApp\TestApp\SilverlightControl1.xaml&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;TestApp&lt;br /&gt;&lt;br /&gt;Warning&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;The property &amp;#39;Resources&amp;#39; does not exist on the type &amp;#39;Grid&amp;#39; in the XML namespace &amp;#39;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;#39;.&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\Michael Sync\MyTechRoom\Silverlight\SL2Beta2\TestApp\TestApp\TestApp\SilverlightControl1.xaml&amp;nbsp;&amp;nbsp; &amp;nbsp;7&amp;nbsp;&amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp; &amp;nbsp;TestApp&lt;br /&gt;&lt;br /&gt;Error&amp;nbsp;&amp;nbsp; &amp;nbsp;3&amp;nbsp;&amp;nbsp; &amp;nbsp;Invalid XmlnsDeclaration occurs in assembly &amp;#39;TestApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&amp;#39;. XmlnsDeclaration references a namespace &amp;#39;TestLibrary2&amp;#39; that is not in the assembly.&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\Michael Sync\MyTechRoom\Silverlight\SL2Beta2\TestApp\TestApp\TestApp\SilverlightControl1.xaml&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;TestApp&lt;br /&gt;&lt;br /&gt;Error&amp;nbsp;&amp;nbsp; &amp;nbsp;4&amp;nbsp;&amp;nbsp; &amp;nbsp;The type &amp;#39;Class1&amp;#39; was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\Michael Sync\MyTechRoom\Silverlight\SL2Beta2\TestApp\TestApp\TestApp\SilverlightControl1.xaml&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;2&amp;nbsp;&amp;nbsp; &amp;nbsp;TestApp&lt;br /&gt;&lt;br /&gt;Error&amp;nbsp;&amp;nbsp; &amp;nbsp;5&amp;nbsp;&amp;nbsp; &amp;nbsp;The attachable property &amp;#39;Resources&amp;#39; was not found in type &amp;#39;Class1&amp;#39;.&amp;nbsp;&amp;nbsp; &amp;nbsp;C:\Michael Sync\MyTechRoom\Silverlight\SL2Beta2\TestApp\TestApp\TestApp\SilverlightControl1.xaml&amp;nbsp;&amp;nbsp; &amp;nbsp;7&amp;nbsp;&amp;nbsp; &amp;nbsp;10&amp;nbsp;&amp;nbsp; &amp;nbsp;TestApp&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/52434.aspx</link><pubDate>Sat, 10 May 2008 22:02:45 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:52434</guid><dc:creator>snyhol</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/52434.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=52434</wfw:commentRss><description>&lt;p&gt;There is a workaround if you want to inherit from a &amp;quot;BaseControl&amp;quot; class&amp;nbsp;in another namespace without having to update the generated &amp;quot;.g.cs&amp;quot; file.&amp;nbsp; This hack is to include the base control&amp;#39;s namespace in a resource.&amp;nbsp; This works because the autogenerated file adds a &amp;quot;using&amp;quot; statement for any namespace referenced in the Resources.&lt;/p&gt;
&lt;p&gt;To apply this workaround, use Michael&amp;#39;s&amp;nbsp;steps #1, #2, and #3 (from the previous post). Instead of editing the generated file (step #4), add a reference to the clr-namespace, and then&amp;nbsp;use this namespace in the Resources.&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;&lt;strong&gt;&lt;font color="#006699"&gt;&lt;span class="tag"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag-name"&gt;BaseControl&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;x:Class&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;SL2Controls.InheritedControl&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;xmlns:x&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;Width&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;400&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;Height&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;300&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span class="attribute-value"&gt;
&lt;div&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;xmlns:basecontrol&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;&lt;font color="#0000ff" size="2"&gt;clr-namespace:SL2Controls.Anothernamespace&lt;/font&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span class="attribute-value"&gt;&lt;/span&gt;&lt;span class="tag"&gt;&lt;strong&gt;&lt;font color="#006699"&gt;&amp;gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&gt;&lt;strong&gt;&lt;font color="#006699"&gt;&lt;span class="tag"&gt;&amp;lt;&lt;/span&gt;&lt;span class="tag-name"&gt;BaseControl.Resources&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="alt"&gt;&lt;span&gt;&lt;strong&gt;&lt;font color="#006699"&gt;&lt;span class="tag-name"&gt;&amp;lt;basecontrol:anyclass&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="attribute"&gt;&lt;font color="#ff0000"&gt;x:Name&lt;/font&gt;&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span class="attribute-value"&gt;&lt;font color="#0000ff"&gt;&amp;quot;anyname&amp;quot; &lt;/font&gt;&lt;font color="#006699"&gt;&lt;strong&gt;/&amp;gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;span&gt;
&lt;li class="alt"&gt;&lt;span&gt;&lt;strong&gt;&lt;font color="#006699"&gt;&lt;span class="tag"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="tag-name"&gt;BaseControl.Resources&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;&lt;/span&gt;&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/42054.aspx</link><pubDate>Fri, 28 Mar 2008 17:02:09 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:42054</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/42054.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=42054</wfw:commentRss><description>&lt;p&gt;I just tested with nested control. The way that I mentioned earlier is working. Actually, the problem that we were having is not the nested control issue. The problem is about putting Base Class in different namespace. &lt;br /&gt; &lt;/p&gt;&lt;p&gt;I posted the sample in this link (&lt;a href="http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance"&gt;http://michaelsync.net/2008/03/24/silverlight-2-beta1-user-control-inheritance&lt;/a&gt;) but I didn&amp;#39;t put the base control in different namespace. If you want this, please change as below based on the sample from the link above. &lt;/p&gt;&lt;p&gt;1. Change BaseControl.cs&lt;/p&gt;&lt;p&gt;namespace SL2Controls.&lt;b&gt;Anothernamespace&lt;/b&gt; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class BaseControl : UserControl {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;2. update assemblyinfo&lt;/p&gt;&lt;p&gt;[assembly: XmlnsDefinition(&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot;, &amp;quot;SL2Controls.Anothernamespace&amp;quot;)]&lt;/p&gt;&lt;p&gt;3. Update InheritedControl.xaml.cs&lt;/p&gt;&lt;p&gt;public partial class InheritedControl : SL2Controls.Anothernamespace.BaseControl {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public InheritedControl() {&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;OR&lt;/p&gt;&lt;p&gt;Add using SL2Controls.Anothernamespace;&amp;nbsp;&lt;/p&gt;&lt;p&gt;4.&amp;nbsp; Update InheritedControl.g.cs&lt;/p&gt;&lt;p&gt;&amp;nbsp;public partial class InheritedControl : SL2Controls.Anothernamespace.BaseControl {&lt;/p&gt;&lt;p&gt;OR&lt;/p&gt;&lt;p&gt;using SL2Controls.Anothernamespace;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Updating the generated file is suck but we have no other way to do that.&amp;nbsp; If you run the sample, you will see it works. if you edit the XAML file, you won&amp;#39;t need to modify the generated file. It&amp;#39;s strange thing. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/41983.aspx</link><pubDate>Fri, 28 Mar 2008 10:56:48 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41983</guid><dc:creator>martinhn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/41983.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=41983</wfw:commentRss><description>&lt;p&gt;Did anyone ever find a solution to the nested controls issue?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m in the same situation. Had a 1.1 app, that uses nested controls, and I get XamlParseExceptions in 2.0.&lt;/p&gt;
&lt;p&gt;Anyone fixed this? &lt;/p&gt;
&lt;p&gt;What about Canvas? Should I use UserControl instead, as the first element in my controls&amp;#39; xaml file?&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35913.aspx</link><pubDate>Tue, 11 Mar 2008 12:31:57 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35913</guid><dc:creator>bratta</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35913.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35913</wfw:commentRss><description>&lt;p&gt;Hey Michael, &lt;/p&gt;
&lt;p&gt;Thanks for that. However; I have already made my controls into usercontrol so I don&amp;#39;t need a fix for that anymore. You might want to wait and see if anyone else have that problem before spending more time on it.&lt;/p&gt;
&lt;p&gt;Apriciate your help.&lt;/p&gt;
&lt;p&gt;-Thomas-&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35907.aspx</link><pubDate>Tue, 11 Mar 2008 12:24:24 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35907</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35907.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35907</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;bratta:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Guntae Park: Thanks. Though that still doesn&amp;#39;t seems to sort my nesting problems. The only I could find to fix that&amp;nbsp;was making all the 1.1 controls that had controls inside them into UserControls.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sorry, Thomas. I&amp;#39;m a lit bit busy with using Web service and&amp;nbsp; Astoria in Silverlight. I will take a look the issue now.. I hope it should work. otherwise, Yi-Lun can help us too. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35904.aspx</link><pubDate>Tue, 11 Mar 2008 12:17:06 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35904</guid><dc:creator>bratta</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35904.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35904</wfw:commentRss><description>&lt;p&gt;Guntae Park: Thanks. Though that still doesn&amp;#39;t seems to sort my nesting problems. The only I could find to fix that&amp;nbsp;was making all the 1.1 controls that had controls inside them into UserControls.&lt;/p&gt;
&lt;p&gt;Yi-Lun Luo: That&amp;#39;s works! It&amp;#39;s a bit nasty but beats having to change the *.g.cs file everytime. Thanks for that! &lt;/p&gt;
&lt;p&gt;Thanks all,&lt;/p&gt;
&lt;p&gt;-Thomas-&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35772.aspx</link><pubDate>Tue, 11 Mar 2008 06:03:57 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35772</guid><dc:creator>Yi-Lun Luo - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35772.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35772</wfw:commentRss><description>&lt;p&gt;You&amp;#39;re right. This can be a work round.&lt;/p&gt;
&lt;p&gt;In the class library project&amp;#39;s AssemblyInfo.cs file, add this:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;[&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;assembly&lt;/font&gt;&lt;font size="2"&gt;: &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;XmlnsDefinition&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;YourNamespace&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)]&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;Now after you add reference to this assembly in your main project, you can use any classes in this namespace in your XAML files.&lt;/p&gt;
&lt;p&gt;But without the namespace mapping, your original code should not work. So this still seems to be an issue...&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35764.aspx</link><pubDate>Tue, 11 Mar 2008 05:39:13 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35764</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35764.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35764</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;Yi-Lun Luo - MSFT:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&amp;#39;m surprised to see this works:&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;:)&amp;nbsp; The solution that I found is breaking the SL rules? :) How can we add our own namespace to&amp;nbsp; &lt;a href="http://schemas.microsoft.com/client/2007"&gt;http://schemas.microsoft.com/client/2007&lt;/a&gt;?&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35757.aspx</link><pubDate>Tue, 11 Mar 2008 04:32:20 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35757</guid><dc:creator>Yi-Lun Luo - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35757.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35757</wfw:commentRss><description>&lt;p&gt;Hello, there&amp;#39;re some issues related to UserControl inheriting that we&amp;#39;re investigating... I&amp;#39;m surprised to see this works:&lt;/p&gt;
&lt;p&gt;&amp;lt;MyUserControlBase x:Class=&amp;quot;SL2Test.Page&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns=&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&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;Canvas Width=&amp;quot;400&amp;quot; Height=&amp;quot;300&amp;quot; Background=&amp;quot;Red&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/MyUserControlBase&amp;gt;&lt;/p&gt;
&lt;p&gt;Actually it shouldn&amp;#39;t work. MyUserControlBase is not in the namespace &lt;a href="http://schemas.microsoft.com/client/2007"&gt;http://schemas.microsoft.com/client/2007&lt;/a&gt;. This xml namespaces maps to a series of clr namespaces such as System.Windows.Controls. But there&amp;#39;s no way it can map to your own namespace. Also this behavior is inconsistent with WPF.&lt;/p&gt;
&lt;p&gt;This is likely to be a bug. I&amp;#39;ll redirect this to our product team. Thanks for letting us know.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35499.aspx</link><pubDate>Mon, 10 Mar 2008 14:15:48 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35499</guid><dc:creator>Guntae Park</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35499.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35499</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;If you want to use &amp;quot;{yourUserControl}.g.cs&amp;quot; for automatic binding xaml object, I don&amp;#39;t know how it&amp;#39;s possible. &lt;/p&gt;
&lt;p&gt;But if you want to port a 1.1 project to 2.0, there is a&amp;nbsp;simple way.&lt;/p&gt;
&lt;p&gt;Try this.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; 1.&amp;nbsp;xaml file&amp;#39;s&amp;nbsp;BuildAction must be&amp;nbsp;changed &amp;#39;SilverlightPage&amp;#39;(or &amp;#39;EmbededResource&amp;#39;) to &amp;#39;Resource&amp;#39;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; 2.&amp;nbsp;in 1.1, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#7820b9"&gt; System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream(&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;{xaml file&amp;#39;s path in 1.1 Style}&lt;/font&gt;&lt;font color="#7820b9"&gt;&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _root = (Canvas)this.InitializeFromXaml(new System.IO.StreamReader(s).ReadToEnd());&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Change this part as follows.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#7820b9"&gt;&amp;nbsp;System.Windows.Resources.StreamResourceInfo sri = System.Windows.Application.GetResourceStream(new System.Uri(&amp;quot;&lt;/font&gt;&lt;font color="#000000"&gt;{xaml file&amp;#39;s path in&amp;nbsp;2.0 Style}&lt;/font&gt;&lt;font color="#7820b9"&gt;&amp;quot;, System.UriKind.Relative));&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; string sXaml = (new System.IO.StreamReader(sri.Stream)).ReadToEnd();&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; this._root &amp;nbsp;= InitializeFromXaml(sXaml) as Canvas;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#7820b9"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;and&amp;nbsp;I make a remark about&amp;nbsp;&amp;#39;xaml file&amp;#39;s path&amp;#39;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in 1.1 -&amp;gt; &amp;nbsp;&amp;nbsp;&amp;#39;{namespace}.{filename}.xaml&amp;#39; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in 2.0 -&amp;gt; &amp;#39;/{assemblyname}; component/{subdirectory}/{filename}.xaml&amp;#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; If you change like this, you cannot use auto-generation of xaml object. So you must manually&amp;nbsp;bind all xaml object&amp;nbsp;to use,&amp;nbsp;as you did&amp;nbsp;in 1.1 alpha.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;but you don&amp;#39;t need to update all the *g.cs files everytime.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; I hope that this answered your question. Good luck!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35292.aspx</link><pubDate>Sun, 09 Mar 2008 22:01:44 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35292</guid><dc:creator>bratta</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35292.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35292</wfw:commentRss><description>&lt;p&gt;Yes I can. But that limits me to use a class in the same namespace as the control. Since I have loads of controls they are divided in different namespaces and I have one class in another namespace that I want to use as the baseclass. In WPF that works by referencing the namespace with an xmlns.&lt;/p&gt;
&lt;p&gt;Example (app is called SilverlightApplication2):&lt;/p&gt;
&lt;p&gt;BaseClass:&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;namespace&lt;/font&gt;&lt;font size="2"&gt; SilverlightApplication2.AnotherNameSpace&lt;br /&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp; public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Class1&lt;/font&gt;&lt;font size="2"&gt;: &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;UserControl&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp; {}&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;Page.xaml.cs:&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;partial&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Page&lt;/font&gt;&lt;font size="2"&gt; : SilverlightApplication2.AnotherNameSpace.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Class1&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp; public&lt;/font&gt;&lt;font size="2"&gt; Page()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Page.xaml (need to add a xmlns to tell it where to find the namespace):&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;test&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Class1&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Class&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;SilverlightApplication2.Page&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;test&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;clr-namespace:SilverlightApplication2.AnotherNameSpace&amp;quot;&lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;a href="http://schemas.microsoft.com/client/2007"&gt;http://schemas.microsoft.com/client/2007&lt;/a&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;br /&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;test&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Class1&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;It works in the designer, it builds fine etc but in InitializeComponent it errors on this line:&lt;br /&gt;&lt;font size="2"&gt;System.Windows.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Application&lt;/font&gt;&lt;font size="2"&gt;.LoadComponent(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; System.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Uri&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/SilverlightApplication2;component/Page.xaml&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, System.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;UriKind&lt;/font&gt;&lt;font size="2"&gt;.Relative));&lt;br /&gt;&lt;br /&gt;Error:&lt;br /&gt;A first chance exception of type &amp;#39;System.Windows.Markup.XamlParseException&amp;#39; occurred in System.Windows.dll&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;Additional information: AG_E_UNKNOWN_ERROR [Line: 6 Position: 95]&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;So it seems the application load component doesn&amp;#39;t support that xaml syntax.&lt;br /&gt;&lt;br /&gt;Any ideas?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;-Thomas-&lt;br /&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35172.aspx</link><pubDate>Sun, 09 Mar 2008 09:50:31 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35172</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35172.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35172</wfw:commentRss><description>&lt;p&gt;oh.&amp;nbsp; I though you are having the problem with nested controls. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/silverlight/images/icon-quote.gif"&gt; &lt;strong&gt;bratta:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Only real problem I have now is the second one, having to manually update all the *g.cs files everytime I change a xaml file or if I do a rebuild....&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;You mean, you can&amp;#39;t use like that? &lt;/p&gt;&lt;p&gt;&amp;lt;&lt;b&gt;MyUserControlBase&lt;/b&gt; x:Class=&amp;quot;SL2Test.Page&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns=&amp;quot;http://schemas.microsoft.com/client/2007&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&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;Canvas Width=&amp;quot;400&amp;quot; Height=&amp;quot;300&amp;quot; Background=&amp;quot;Red&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/&lt;b&gt;MyUserControlBase&lt;/b&gt;&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Porting a 1.1 project to 2.0 - Usercontrol inheritance and nested resources</title><link>http://forums.silverlight.net/forums/thread/35154.aspx</link><pubDate>Sun, 09 Mar 2008 07:13:13 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35154</guid><dc:creator>bratta</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35154.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=35154</wfw:commentRss><description>&lt;p&gt;Hey again. &lt;/p&gt;
&lt;p&gt;Yes, nesting usercontrols works fine, which is what I am doing&amp;nbsp;now (just annoying having to change all the current controls). The problem arises when they are controls with a build action of &amp;quot;embedded resources&amp;quot; and you&amp;nbsp;use the &lt;font size="2"&gt;InitializeFromXaml to load in the XAML (please see the example I sent you). &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I have made all the controls that had custom controls inside them to usercontrols to make this work. Only real problem I have now is the second one, having to manually update all the *g.cs files everytime I change a xaml file or if I do a rebuild....&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Cheers,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;-Thomas-&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>