<?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: Silverlight 2 Post Beta2 Gotcha - ContentPresenter</title><link>http://forums.silverlight.net/forums/thread/98777.aspx</link><pubDate>Sun, 28 Sep 2008 21:51:52 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:98777</guid><dc:creator>zbychuk</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/98777.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=98777</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;Very&lt;/strong&gt; unconvincing arguments - what if I want to standarise font accross whole application? Is really forcing users to define font in each use fo the component a good practice? I do not think so! &lt;/p&gt;
&lt;p&gt;What if I wish to write RoundButtonWithSansComicOfSize24 ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Silverlight 2 Post Beta2 Gotcha - ContentPresenter</title><link>http://forums.silverlight.net/forums/thread/98763.aspx</link><pubDate>Sun, 28 Sep 2008 20:34:48 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:98763</guid><dc:creator>JeffHandley</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/98763.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=98763</wfw:commentRss><description>&lt;p&gt;Jesse Liberty has posted about this topic too after I requested better explanation of the change.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://silverlight.net/blogs/jesseliberty/archive/2008/09/28/rc0-amp-contentpresenter.aspx"&gt;http://silverlight.net/blogs/jesseliberty/archive/2008/09/28/rc0-amp-contentpresenter.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Silverlight 2 Post Beta2 Gotcha - ContentPresenter</title><link>http://forums.silverlight.net/forums/thread/97511.aspx</link><pubDate>Fri, 26 Sep 2008 07:05:48 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:97511</guid><dc:creator>JeffHandley</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/97511.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=97511</wfw:commentRss><description>&lt;p&gt;I posted this to my &lt;a class="" href="http://blog.jeffhandley.com/archive/2008/09/25/silverlight-2-post-beta2-gotcha---contentpresenter.aspx"&gt;blog&lt;/a&gt;, but I also wanted to provide this information on these forums.&lt;/p&gt;
&lt;p&gt;As I&amp;#39;m sure you already know, a Release Candidate for Silverlight 2 was &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/25/silverlight-2-release-candidate-now-available.aspx" target="_blank"&gt;published&lt;/a&gt;.&amp;nbsp; ScottGu does an amazing job of covering a lot of information in his blog posts, and others like &lt;a href="http://silverlight.net/blogs/msnow/archive/2008/09/25/silverlight-version-2-rc0-release.aspx" target="_blank"&gt;Mike Snow&lt;/a&gt; have also provided some excellent detail.&amp;nbsp; As they repeatedly told you, go check out the &lt;a href="http://download.microsoft.com/download/6/F/E/6FE1F43D-9D0C-4346-AD08-602DF9BCB3CF/BreakingChangesBetweenBeta2andRelease.doc" target="_blank"&gt;breaking changes document&lt;/a&gt; that lists all breaking changes from Beta2 to this release candidate.&lt;/p&gt;
&lt;p&gt;If you have a Silverlight application that runs against Beta2, please take immediate action to get it moved (in a test environment) to the RC bits.&amp;nbsp; There were a bunch of breaking changes (all for the better) and some of them might adversely affect your applications.&amp;nbsp; Since there isn&amp;#39;t a release date for Silverlight 2 yet, I would recommend working quickly to make sure you are ready whenever it is released.&amp;nbsp; It&amp;#39;s impossible to estimate how long it will take to complete the migration, so if you put it off, you might find yourself with a broken application once the final release is put out.&lt;/p&gt;
&lt;p&gt;With all of that said, there is one gotcha that I want to highlight for you tonight.&amp;nbsp; This one caused some trouble for me when porting an application from Beta 2 to the newer bits.&amp;nbsp; I&amp;#39;m talking about the base class change to ContentPresenter.&amp;nbsp; In Beta2, ContentPresenter derived from Control; in the new bits, it derives from FrameworkElement.&amp;nbsp; This might not sound impactful, but it really is.&amp;nbsp; For starters, here&amp;#39;s the list of properties that are now removed from ContentPresenter because of this change:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Background 
&lt;li&gt;BorderBrush 
&lt;li&gt;BorderThickness 
&lt;li&gt;DefaultStyleKey 
&lt;li&gt;FontFamily 
&lt;li&gt;FontSize 
&lt;li&gt;FontStretch 
&lt;li&gt;FontStyle 
&lt;li&gt;FontWeight 
&lt;li&gt;Foreground 
&lt;li&gt;HorizontalContentAlignment 
&lt;li&gt;IsEnabled 
&lt;li&gt;IsTabStop 
&lt;li&gt;Padding 
&lt;li&gt;TabIndex 
&lt;li&gt;TabNavigation 
&lt;li&gt;Template 
&lt;li&gt;VerticalContentAlignment &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;That&amp;#39;s a pretty long list!&amp;nbsp; And to make matters worse, I think that every single ContentPresenter I encountered in the app I ported was using at least half of these properties.&amp;nbsp; That meant that the XAML had to be updated so that these properties were set on a container control that included the ContentPresenter.&amp;nbsp; In some cases, that was straight-forward, but in others, it wasn&amp;#39;t as simple.&lt;/p&gt;
&lt;p&gt;Now, for the real kick in the pants... If you have some of these properties set on a ContentPresenter, within your XAML, your application will build just fine.&amp;nbsp; It might even run and begin to function.&amp;nbsp; But eventually, the parser will try to load this portion of the XAML and it will barf.&amp;nbsp; You will get really bizarre errors like this: &lt;em&gt;Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))&lt;/em&gt;.&amp;nbsp; The stack trace will look very scary and it will point you nowhere near your ContentPresenter.&lt;/p&gt;
&lt;p&gt;In my experience, this caused some major headaches.&amp;nbsp; Sometimes the app would run, sometimes it wouldn&amp;#39;t.&amp;nbsp; Sometimes all screens would work, sometimes they wouldn&amp;#39;t.&amp;nbsp; When it did crash, it would crash with a different stack trace each time it seemed.&amp;nbsp; The common thread was the catastrophic failure E_UNEXPECTED, even though the rest of the stack trace would vary widely.&lt;/p&gt;
&lt;p&gt;Since examining the stack traces eventually proved to be a fruitless effort, I started removing XAML one block at a time from all content in the application.&amp;nbsp; Ultimately, I found that one of the XAML files had some errors in it when opened in VS.&amp;nbsp; When I had the file open, I could see that there were errors reported about the bad properties on the ContentPresenter.&amp;nbsp; Once I got rid of all of the obsolete properties from all of the ContentPresenter controls in the entire app, it ran smoothly.&amp;nbsp; I then just had to restyle some things to restore the desired presentation.&lt;/p&gt;
&lt;p&gt;So, if you have a Silverlight Beta2 application that you are porting to the RC (or final) build, beware of your ContentPresenter controls.&amp;nbsp; If you get strange and sporadic errors from anywhere in your application, don&amp;#39;t assume the problems are near where the failure was.&amp;nbsp; Just open all of your XAML files in the editor and look for errors on your ContentPresenters.&amp;nbsp; Once you get rid of the obsolete properties, you will be in much better shape.&lt;/p&gt;
&lt;p&gt;Now, go update your application to work against the release candidate!&lt;/p&gt;</description></item></channel></rss>