<?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>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/35396.aspx</link><pubDate>Mon, 10 Mar 2008 08:30:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35396</guid><dc:creator>yourbuddypal</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35396.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=35396</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;robhouweling:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been experimenting some more with this. The solution Michael offers&amp;nbsp;seems to be working when only using VS2008. When you open the page.xaml in Blend however, Blend returns the error &amp;quot;Invalid XAML&amp;quot;.&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s not a workable solution if my designers can&amp;#39;t change the XAML anymore.&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To design the code, you need to change the outer element back to the UserControl only for editing. When done editing, it should be changed back to whatever your custom class name is.&amp;nbsp; The only downside is that you cannot see the designer in VS.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/35384.aspx</link><pubDate>Mon, 10 Mar 2008 07:52:46 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35384</guid><dc:creator>robhouweling</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35384.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=35384</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been experimenting some more with this. The solution Michael offers&amp;nbsp;seems to be working when only using VS2008. When you open the page.xaml in Blend however, Blend returns the error &amp;quot;Invalid XAML&amp;quot;.&lt;/p&gt;
&lt;p&gt;So it&amp;#39;s not a workable solution if my designers can&amp;#39;t change the XAML anymore.&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/35216.aspx</link><pubDate>Sun, 09 Mar 2008 15:31:24 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35216</guid><dc:creator>mchlSync</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35216.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=35216</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;Dave Relyea:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;This...um...&amp;quot;limitation&amp;quot; is on the list of stuff to fix.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I dont think this is a limitation. I have tested and posted the solution in &lt;a href="http://silverlight.net/forums/t/10970.aspx"&gt;this post&amp;nbsp;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;It works for me and a few people said that my solution works for them too. &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/35214.aspx</link><pubDate>Sun, 09 Mar 2008 15:19:14 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35214</guid><dc:creator>Dave Relyea</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35214.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=35214</wfw:commentRss><description>&lt;p&gt;This...um...&amp;quot;limitation&amp;quot; is on the list of stuff to fix.&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/35162.aspx</link><pubDate>Sun, 09 Mar 2008 08:44:20 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:35162</guid><dc:creator>parimaln</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/35162.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=35162</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The answer in thi ssolution helped me.&lt;/p&gt;
&lt;p&gt;Hope this helps you all.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;a href="http://silverlight.net/forums/t/10970.aspx"&gt;http://silverlight.net/forums/t/10970.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;regards,&lt;/p&gt;
&lt;p&gt;Parimaln&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34513.aspx</link><pubDate>Fri, 07 Mar 2008 03:01:20 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34513</guid><dc:creator>RodKestler</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34513.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34513</wfw:commentRss><description>&lt;p&gt;I had previously posted that this was a bug I had confirmed myself, which remains true. The workaround however is easy and has desirable side effects in terms of design. The correct means / workaround of instantiating the outer most container for a full-page experience - for instance in the case where you have a page-like type which has some extensive base functionality, such as layout handling - you will want to insure that you are using the new Silverlight Xap architecture. So, you would:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Make sure you have added a System.Windows.Application derived Application object to your Silverlight application. &lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Then set the application as the startup object from the Silverlight Application properties pages (Silverlight tab, Startup Object dropdown)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;The default application implementation supplied by Visual Studio will hook the Application event called &amp;quot;Startup&amp;quot; and provide you with an empty event handling method. The method will be named &amp;quot;Application_Startup&amp;quot;.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;In the code for this method, simply instantiate your strongly typed container class/control, assigning it to the Application&amp;#39;s RootVisual&amp;nbsp;property&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Example:&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;public DemoApp()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;this.Startup += this.Application_Startup;&lt;br /&gt;&amp;nbsp;this.Exit += this.Application_Exit;&lt;br /&gt;&amp;nbsp;this.UnhandledException += this.Application_UnhandledException;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;InitializeComponent();&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;private void Application_Startup(object sender, StartupEventArgs e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;this.RootVisual = new DemoPage(); //This can be any type in the application assembly/project or any other referenced Silverlight assembly&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;This is a reasonable and desirable workaround, since you get the benefits of the Xaml Application, which provides the custom/stock splash screen feature. I am sure this parser issue was a side-effect of a &amp;quot;by design&amp;quot; decision, and/or the direct Xaml load case was not caught during unit testing. In any case, the alternative is more desirable in overall behavior. I hope this helps anyone who may be puzzled by the AG_E parser error from the previous loading technique typically used in Alpha 1.1.&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34406.aspx</link><pubDate>Thu, 06 Mar 2008 20:27:53 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34406</guid><dc:creator>RodKestler</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34406.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34406</wfw:commentRss><description>&lt;p&gt;So, it&amp;#39;s a &amp;quot;limitation&amp;quot; - any idea when this &amp;quot;limitation&amp;quot; might be &amp;quot;optimized&amp;quot;?&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34393.aspx</link><pubDate>Thu, 06 Mar 2008 19:50:46 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34393</guid><dc:creator>RodKestler</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34393.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34393</wfw:commentRss><description>&lt;p&gt;Indeed, I can corroborate the error. Basically, you can&amp;#39;t inherit beyond the base implementation of the outer container type. So if you have a a container the inherits directly from UserControl, the parser can handle it, but if you derive from another base class, with inherited functionality, it will throw the AG_E_UNKNOWN_ERROR. This was not the case in Alpha 1.1, so logic dictates this is not only a bug, but a serious show stopper bug.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Actually, this build is terrible. TextBox and WatermarkTextBox do not even scroll correctly when text longer than the width of the text box is entered. Luckily I have TextBoxes that do work - very sad Microsoft. I guess no one bothered to unit test. Very amateur. And now we have an inheritance related parser error which prevents developers from using any polymorphic outer container types, which I&amp;#39;m going to wager is a COMMON situation.&lt;/p&gt;
&lt;p&gt;If anyone figures out a workaround for the parser-inheritance issue, please email me at &lt;a href="mailto:rod@hatchinnovations.com"&gt;rod@hatchinnovations.com&lt;/a&gt;. I&amp;#39;ll do the same. I&amp;#39;m looking at possible adapter patterns that can work around this embarassing kludge. Shame on you Microsoft. I am embarassed for you.&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34367.aspx</link><pubDate>Thu, 06 Mar 2008 18:43:53 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34367</guid><dc:creator>robhouweling</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34367.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34367</wfw:commentRss><description>&lt;p&gt;Hi Pete,&lt;/p&gt;
&lt;p&gt;Thanks for the quick reply.&lt;/p&gt;
&lt;p&gt;Do you know is this limitation is going to be changed in one of the next versions or is this going to remain like this from now on?&lt;/p&gt;
&lt;p&gt;And, do you know what the reason for this limitation is? It wasn&amp;#39;t like this in SL1.1 alpha and it is different in ASP.NET (perhaps also in WPF?)&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Rob Houweling.&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34296.aspx</link><pubDate>Thu, 06 Mar 2008 16:02:30 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34296</guid><dc:creator>kgalenko</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34296.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34296</wfw:commentRss><description>&lt;p&gt;To make it happen you have to update 2 files, c# and xaml all together.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Your xaml file references UserControl class and you need to replace it with your custom class PageContent like this:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;src:PageContent x.Class=&amp;quot;Home&amp;quot;&lt;/p&gt;&lt;p&gt;...&amp;nbsp;&lt;/p&gt;&lt;p&gt;xmlns:scr=&amp;quot;clr-namespace:YourNameSpaceHere&amp;quot;&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;gt;&lt;/p&gt;&lt;p&gt;....&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;lt;/src:PageContent&amp;gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;that will tell compiler to use your custom class as base class and look for it in your assembly. But I found another problem. While I can compile and see control in VS 2008, Blend can&amp;#39;t render it, which I can understand, but when you run the app every time silverlight tries to render this control it produces a parser error: AG_E_UNKNOWN_ERROR.&lt;/p&gt;&lt;p&gt; It looks like it works ok for desktop apps but not for silverlight.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Konstantin&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34289.aspx</link><pubDate>Thu, 06 Mar 2008 15:40:13 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34289</guid><dc:creator>Psychlist1972</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34289.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34289</wfw:commentRss><description>&lt;p&gt;There&amp;#39;s a limitation in Silverlight 2 Beta 1 that does not allow you to markup anything that derives from a custom class (even if that class derives from UserControl).&lt;/p&gt;
&lt;p&gt;It&amp;#39;s something you&amp;#39;ll need to work around for now.&lt;/p&gt;
&lt;p&gt;Pete&lt;/p&gt;</description></item><item><title>Re: A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34281.aspx</link><pubDate>Thu, 06 Mar 2008 15:23:07 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34281</guid><dc:creator>robhouweling</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34281.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34281</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having the same problem here. Removing the inheritance from the generated class (as it is in a webcontrol in asp.net)&amp;nbsp;is also a&amp;nbsp;workaround with the same result (saving XAML returns the inheretence).&lt;/p&gt;
&lt;p&gt;Looks like a bug to me. It should be possible to use inheritance from your codebehind.&lt;/p&gt;
&lt;p&gt;Please let me know if there&amp;#39;s a solution.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Rob Houweling&lt;/p&gt;</description></item><item><title>A question on inheritance</title><link>http://forums.silverlight.net/forums/thread/34261.aspx</link><pubDate>Thu, 06 Mar 2008 14:27:54 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:34261</guid><dc:creator>markk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/34261.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=34261</wfw:commentRss><description>&lt;p&gt;Hi everyone..hoping someone may have an answer to this. &lt;/p&gt;
&lt;p&gt;I have a UserControl that needs to inherit some base functionality. This base functionality has been placed into a seperate class i.e &lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&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;class&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;PageContent&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;UserControl&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{......}&lt;/p&gt;
&lt;p&gt;All UserControl then inherit from the above i.e.&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&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;Home&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;PageContent&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;{....}&lt;/p&gt;
&lt;p&gt;However when compiling you receive the error : Error&amp;nbsp;2&amp;nbsp;Partial declarations of a.POC.Silverlight.Content.Home&amp;#39; must not specify different base classes&amp;nbsp;d:\a\v2\a.poc.silverlight\a.poc.silverlight\obj\debug\content\home.g.cs&amp;nbsp;35&amp;nbsp;26&amp;nbsp;a.POC.Silverlight.&lt;/p&gt;
&lt;p&gt;Which is understandable because the generated file Home.g.cs contains the following constructor definition:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&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;Home&lt;/font&gt;&lt;font size="2"&gt; : System.Windows.Controls.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;UserControl&lt;/font&gt;&lt;font size="2"&gt; {....}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;If I change the inherited class System.Windows.Controls.UserControl to PageContent, all is well. However if I then edit the Home.xaml file, the autogenerated file gets regenerated with the System.Windows.Controls.UserControls...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Is there anyway around this. It all seemed fine in SL1.1 however in 2.0 not so :-(&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>