<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Bryant Likes's Blog</title><link>http://blogs.sqlxml.org/bryantlikes/default.aspx</link><description>It&amp;#39;s all about WebData</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/BryantLikesBlog" type="application/rss+xml" /><feedburner:emailServiceId>BryantLikesBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Faking the Initialized Event in Silverlight</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/YFPcSqHKbSc/faking-the-initialized-event-in-silverlight.aspx</link><pubDate>Wed, 25 Mar 2009 00:24:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:454365</guid><dc:creator>bryantlikes</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=454365</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/24/faking-the-initialized-event-in-silverlight.aspx#comments</comments><description>&lt;p&gt;This is another nugget of gold gleaned from the &lt;a href="http://videos.visitmix.com/MIX09/06W"&gt;Climbing Mt Avalon workshop&lt;/a&gt;, although I believe this one came from &lt;a href="http://twitter.com/JonathanRuss"&gt;Jonathan Russ&lt;/a&gt;. He was talking about a bunch of threading tricks in WPF and showed how if you wanted to run some code after everything was initialized you could use the BeginInvoke method of the Dispatcher object. Since there are many places in my code where I want to execute something when the control loads, but only once (since the loaded event gets fired whenever the object gets re-added to the visual tree) I end up writing a lot of code like:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Page : UserControl
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; initialized = &lt;span class="kwrd"&gt;false&lt;/span&gt;;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; Page()
    {
        InitializeComponent();
        Loaded += &lt;span class="kwrd"&gt;new&lt;/span&gt; RoutedEventHandler(Page_Loaded);
    }

    &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Loaded(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!initialized)
        {
            &lt;span class="rem"&gt;// do some initialization work&lt;/span&gt;
            initialized = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
        }
    }

}&lt;/pre&gt;
&lt;p&gt;This works, but it isn&amp;rsquo;t perfect and there seems to be a lot of issues with the &lt;a href="http://blogs.msdn.com/silverlight_sdk/archive/2008/10/24/loaded-event-timing-in-silverlight.aspx"&gt;timing&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.loaded(VS.95).aspx"&gt;of&lt;/a&gt; &lt;a href="http://silverlight.net/forums/p/40306/115105.aspx#115105"&gt;the&lt;/a&gt; &lt;a href="http://blogs.msdn.com/devdave/archive/2008/10/11/control-lifecycle.aspx"&gt;loaded event&lt;/a&gt;. So based on what Jonathan was saying, you could instead just put a call into BeginInvoke in the contructor like so:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Page : UserControl
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; Page()
    {
        InitializeComponent();
        Dispatcher.BeginInvoke(Initialized);
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Initialized()
    {
        &lt;span class="rem"&gt;// do some initialization work&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;p&gt;

So what is this actually doing? BeginInvoke puts a message in the message pump that is running under the covers of everything (note: I&amp;rsquo;m not a C++ programming so I don&amp;rsquo;t really fully understand &lt;a href="http://en.wikipedia.org/wiki/Event_loop"&gt;message pumps&lt;/a&gt; so this is an over simplification). Because it is last in line in the queue of messages to process, it gets executed after all the other initialization code which has already lined up. If you debug this you will see it actually gets called after the Loaded event gets called. However, this code is the first thing to execute once everything has been loaded and setup which is usually when I want my code to execute. &lt;/p&gt;
&lt;p&gt;So this is a much better way to handle initialization code since you aren&amp;rsquo;t adding event handlers that really only need to fire once and it executes once everything is fully initialized.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=454365" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YeVdb8CCA-0qQxMSLQtYk-RzEVw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YeVdb8CCA-0qQxMSLQtYk-RzEVw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YeVdb8CCA-0qQxMSLQtYk-RzEVw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YeVdb8CCA-0qQxMSLQtYk-RzEVw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=YFPcSqHKbSc:MhCK4n0f1O0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=YFPcSqHKbSc:MhCK4n0f1O0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=YFPcSqHKbSc:MhCK4n0f1O0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/YFPcSqHKbSc" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/24/faking-the-initialized-event-in-silverlight.aspx</feedburner:origLink></item><item><title>Animation Hack Using Attached Properties in Silverlight</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/QuyEtVPGCwU/animation-hack-using-attached-properties-in-silverlight.aspx</link><pubDate>Mon, 23 Mar 2009 22:27:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:454170</guid><dc:creator>bryantlikes</dc:creator><slash:comments>10</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=454170</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/23/animation-hack-using-attached-properties-in-silverlight.aspx#comments</comments><description>&lt;p&gt;In &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2009/03/18/styling-hack-using-attached-properties-in-silverlight.aspx"&gt;my last post I blogged about using Attached Properties&lt;/a&gt; to get around the limitation that only Dependency Properties can be animated. One astute commented noted that he was guessing this could be applied to animations as well and the answer is yet it can. However, it requires one extra step that makes it a little less appealing. &lt;/p&gt;
&lt;p&gt;Also I mentioned in my last post, I got this idea from the Climbing Mt Avalon workshop at MIX which has &lt;a href="http://videos.visitmix.com/MIX09/06W"&gt;now been posted online&lt;/a&gt; and I would recommend watching if you&amp;rsquo;re doing Silverlight or WPF work. And now on to the code&amp;hellip;&lt;/p&gt;
&lt;p&gt;Typically if you want to animating something like the width of a grid in a column that isn&amp;rsquo;t animatable either because it isn&amp;rsquo;t a double, color, or another easily animatable type, then you would declare a dependency property on your own host class, usually a UserControl, and then animate that instead. A &lt;a href="http://programmerpayback.com/2008/11/08/animate-collapsing-a-grid-column-or-row-in-silverlight/"&gt;good example is this blog post&lt;/a&gt; on the subject which is what I&amp;rsquo;ve referred to many times. &lt;/p&gt;
&lt;p&gt;However, if we take the attached property route instead of putting the code in our user control, we could declare our own attached property to do the work for us. Here is a simple example:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public static class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Attachments
&lt;/span&gt;{

    &lt;span style="color:blue;"&gt;public static readonly &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DependencyProperty &lt;/span&gt;ColumnWidthProperty =
            &lt;span style="color:#2b91af;"&gt;DependencyProperty&lt;/span&gt;.RegisterAttached(&lt;span style="color:#a31515;"&gt;&amp;quot;ColumnWidth&amp;quot;&lt;/span&gt;, 
            &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:blue;"&gt;double&lt;/span&gt;), &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Attachments&lt;/span&gt;), 
            &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyMetadata&lt;/span&gt;(
                &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyChangedCallback&lt;/span&gt;(OnColumnWidthChanged)));

    &lt;span style="color:blue;"&gt;public static void &lt;/span&gt;SetColumnWidth(&lt;span style="color:#2b91af;"&gt;DependencyObject &lt;/span&gt;o, &lt;span style="color:blue;"&gt;double &lt;/span&gt;value)
    {
        o.SetValue(ColumnWidthProperty, value);
    }

    &lt;span style="color:blue;"&gt;public static double &lt;/span&gt;GetColumnWidth(&lt;span style="color:#2b91af;"&gt;DependencyObject &lt;/span&gt;o)
    {
        &lt;span style="color:blue;"&gt;return &lt;/span&gt;(&lt;span style="color:blue;"&gt;double&lt;/span&gt;)o.GetValue(ColumnWidthProperty);
    }

    &lt;span style="color:blue;"&gt;private static void &lt;/span&gt;OnColumnWidthChanged(&lt;span style="color:#2b91af;"&gt;DependencyObject &lt;/span&gt;d, &lt;span style="color:#2b91af;"&gt;DependencyPropertyChangedEventArgs &lt;/span&gt;e)
    {
        ((&lt;span style="color:#2b91af;"&gt;ColumnDefinition&lt;/span&gt;)d).Width = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;GridLength&lt;/span&gt;((&lt;span style="color:blue;"&gt;double&lt;/span&gt;)e.NewValue);
    }

}&lt;/pre&gt;
&lt;p&gt;Once we have this code we can now simply animate the attached property like so:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;UserControl &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Class&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;SilverlightApplication1.MainPage&amp;quot;
    &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; 
    &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;local&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;clr-namespace:SilverlightApplication1&amp;quot;
    &lt;/span&gt;&lt;span style="color:red;"&gt;Width&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;400&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Height&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;300&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;LayoutRoot&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Background&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;White&amp;quot;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Storyboard &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;expandBlue&amp;quot;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;DoubleAnimation &lt;/span&gt;&lt;span style="color:red;"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;blue&amp;quot;
                                 &lt;/span&gt;&lt;span style="color:red;"&gt;To&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;300&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0:0:1&amp;quot; /&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;DoubleAnimation &lt;/span&gt;&lt;span style="color:red;"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;red&amp;quot;
                                 &lt;/span&gt;&lt;span style="color:red;"&gt;To&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0:0:1&amp;quot; /&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Storyboard&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Storyboard &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;expandRed&amp;quot;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;DoubleAnimation &lt;/span&gt;&lt;span style="color:red;"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;red&amp;quot;
                                 &lt;/span&gt;&lt;span style="color:red;"&gt;To&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;300&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0:0:1&amp;quot; /&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;DoubleAnimation &lt;/span&gt;&lt;span style="color:red;"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;blue&amp;quot;
                                 &lt;/span&gt;&lt;span style="color:red;"&gt;To&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Duration&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0:0:1&amp;quot; /&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Storyboard&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;blue&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;local&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Attachments.ColumnWidth&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;200&amp;quot; /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;red&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;local&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Attachments.ColumnWidth&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;200&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="color:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Fill&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Blue&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;MouseLeftButtonDown&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Blue_MouseLeftButtonDown&amp;quot; /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="color:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Fill&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Red&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;MouseLeftButtonDown&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Red_MouseLeftButtonDown&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;UserControl&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Unfortunately if you try the above code (after adding in the mouse event handlers) it won&amp;rsquo;t work. Why not? Well there seems to be an issue with animating custom attached properties when setting the target property directly in code (actually you&amp;rsquo;ll notice I left that out above. However, there is a way around it which I found over on &lt;a href="http://blogs.msdn.com/edmaia/archive/2008/10/16/animating-custom-attached-properties-in-sl2.aspx"&gt;Ed&amp;rsquo;s blog which is to set the target property in code&lt;/a&gt;. So here is the code behind with the work around:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public partial class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;MainPage &lt;/span&gt;: &lt;span style="color:#2b91af;"&gt;UserControl
&lt;/span&gt;{
    &lt;span style="color:blue;"&gt;public &lt;/span&gt;MainPage()
    {
        InitializeComponent();
        &lt;span style="color:#2b91af;"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(expandBlue.Children[0], &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Attachments&lt;/span&gt;.ColumnWidthProperty));
        &lt;span style="color:#2b91af;"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(expandBlue.Children[1], &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Attachments&lt;/span&gt;.ColumnWidthProperty));
        &lt;span style="color:#2b91af;"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(expandRed.Children[0], &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Attachments&lt;/span&gt;.ColumnWidthProperty));
        &lt;span style="color:#2b91af;"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(expandRed.Children[1], &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Attachments&lt;/span&gt;.ColumnWidthProperty));
    }

    &lt;span style="color:blue;"&gt;private void &lt;/span&gt;Blue_MouseLeftButtonDown(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;MouseButtonEventArgs &lt;/span&gt;e)
    {
        expandBlue.Begin();
    }

    &lt;span style="color:blue;"&gt;private void &lt;/span&gt;Red_MouseLeftButtonDown(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;MouseButtonEventArgs &lt;/span&gt;e)
    {
        expandRed.Begin();
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;Once we set the target property via code, then everything works great. However, that is a pain and makes things a lot less clean. But still I think this is a useful approach to animating the properties that are not easily animatable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=454170" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pkO7R1XE_YWgtSpthmEg_k16Cig/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pkO7R1XE_YWgtSpthmEg_k16Cig/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pkO7R1XE_YWgtSpthmEg_k16Cig/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pkO7R1XE_YWgtSpthmEg_k16Cig/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=QuyEtVPGCwU:iCr6RxVddR0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=QuyEtVPGCwU:iCr6RxVddR0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=QuyEtVPGCwU:iCr6RxVddR0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/QuyEtVPGCwU" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/UX/default.aspx">UX</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/23/animation-hack-using-attached-properties-in-silverlight.aspx</feedburner:origLink></item><item><title>Styling Hack Using Attached Properties in Silverlight</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/BVPTA979hF8/styling-hack-using-attached-properties-in-silverlight.aspx</link><pubDate>Thu, 19 Mar 2009 00:08:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:453310</guid><dc:creator>bryantlikes</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=453310</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/18/styling-hack-using-attached-properties-in-silverlight.aspx#comments</comments><description>&lt;p&gt;I need to find the forum post where this question was asked, but I&amp;rsquo;ll have to do that later since I&amp;rsquo;m at MIX09 and searching the forums is low on my list. But I wanted to share a cool hack that I came across in the &lt;a href="http://live.visitmix.com/Agenda/Workshops.aspx#hiking-mt-avalon"&gt;Climbing Mt Avalon&lt;/a&gt; (it was definitely a climb, not a hike).&amp;nbsp; One of the many cool things that was shared was a tidbit by &lt;a href="http://blogs.msdn.com/jaimer/"&gt;Jaime Rodriguez&lt;/a&gt; about using Attached Properties. &lt;/p&gt;
&lt;p&gt;The question in the forums was how you can style the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.verticalscrollbarvisibility(vs.95).aspx"&gt;VerticalScrollBarVisibility&lt;/a&gt; property on a TextBox. The problem is that since this property isn&amp;rsquo;t a &lt;a href="http://msdn.microsoft.com/en-us/library/cc221408(VS.95).aspx"&gt;DependencyProperty&lt;/a&gt;&amp;nbsp; so it can&amp;rsquo;t be styled. You can test this out by trying the following Xaml:&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;width:97.5%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;cursor:text;border:silver 1px solid;padding:4px;"&gt;
&lt;div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;
&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum1" style="color:#606060;"&gt;   1:&lt;/span&gt; &amp;lt;UserControl x:Class=&lt;span style="color:#006080;"&gt;&amp;quot;Attachment.Page&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum2" style="color:#606060;"&gt;   2:&lt;/span&gt;     xmlns=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum3" style="color:#606060;"&gt;   3:&lt;/span&gt;     xmlns:x=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum4" style="color:#606060;"&gt;   4:&lt;/span&gt;     Width=&lt;span style="color:#006080;"&gt;&amp;quot;400&amp;quot;&lt;/span&gt; Height=&lt;span style="color:#006080;"&gt;&amp;quot;300&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum5" style="color:#606060;"&gt;   5:&lt;/span&gt;     &amp;lt;UserControl.Resources&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum6" style="color:#606060;"&gt;   6:&lt;/span&gt;         &amp;lt;Style TargetType=&lt;span style="color:#006080;"&gt;&amp;quot;TextBox&amp;quot;&lt;/span&gt; x:Key=&lt;span style="color:#006080;"&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum7" style="color:#606060;"&gt;   7:&lt;/span&gt;             &amp;lt;Setter Property=&lt;span style="color:#006080;"&gt;&amp;quot;FontSize&amp;quot;&lt;/span&gt; Value=&lt;span style="color:#006080;"&gt;&amp;quot;24&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum8" style="color:#606060;"&gt;   8:&lt;/span&gt;             &amp;lt;Setter Property=&lt;span style="color:#006080;"&gt;&amp;quot;VerticalScrollBarVisibility&amp;quot;&lt;/span&gt; Value=&lt;span style="color:#006080;"&gt;&amp;quot;Visible&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum9" style="color:#606060;"&gt;   9:&lt;/span&gt;         &amp;lt;/Style&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum10" style="color:#606060;"&gt;  10:&lt;/span&gt;     &amp;lt;/UserControl.Resources&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum11" style="color:#606060;"&gt;  11:&lt;/span&gt;     &amp;lt;Grid x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; Background=&lt;span style="color:#006080;"&gt;&amp;quot;White&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum12" style="color:#606060;"&gt;  12:&lt;/span&gt;      &amp;lt;TextBox Text=&lt;span style="color:#006080;"&gt;&amp;quot;This is a test&amp;quot;&lt;/span&gt; Style=&lt;span style="color:#006080;"&gt;&amp;quot;{StaticResource test}&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum13" style="color:#606060;"&gt;  13:&lt;/span&gt;     &amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum14" style="color:#606060;"&gt;  14:&lt;/span&gt; &amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you try to run this it will fail. So how can we set this property in style? Well, a trick you can use is to set your own attached property and then have the property set the VerticalScrollBarVisibility property on the TextBox for you. Here is a very quick example that I cooked up (using &lt;a href="http://blog.nerdplusart.com/archives/silverlight-code-snippets"&gt;Robby&amp;rsquo;s code snippet&lt;/a&gt;):&lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;width:97.5%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;cursor:text;border:silver 1px solid;padding:4px;"&gt;
&lt;div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;
&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum1" style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;namespace&lt;/span&gt; Attachment&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum2" style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum3" style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; Attachments&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum4" style="color:#606060;"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum5" style="color:#606060;"&gt;   5:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;readonly&lt;/span&gt; DependencyProperty MyVsbvProperty =&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum6" style="color:#606060;"&gt;   6:&lt;/span&gt;             DependencyProperty.RegisterAttached(&lt;span style="color:#006080;"&gt;&amp;quot;MyVsbv&amp;quot;&lt;/span&gt;, &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum7" style="color:#606060;"&gt;   7:&lt;/span&gt;                 &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(ScrollBarVisibility), &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum8" style="color:#606060;"&gt;   8:&lt;/span&gt;                 &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(Attachments), &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum9" style="color:#606060;"&gt;   9:&lt;/span&gt;                 &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; PropertyMetadata(OnMyVsbvChanged));&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum10" style="color:#606060;"&gt;  10:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum11" style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SetMyVsbv(DependencyObject o, ScrollBarVisibility &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;)&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum12" style="color:#606060;"&gt;  12:&lt;/span&gt;         {&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum13" style="color:#606060;"&gt;  13:&lt;/span&gt;             o.SetValue(MyVsbvProperty, &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;);&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum14" style="color:#606060;"&gt;  14:&lt;/span&gt;         }&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum15" style="color:#606060;"&gt;  15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum16" style="color:#606060;"&gt;  16:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; ScrollBarVisibility GetMyVsbv(DependencyObject o)&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum17" style="color:#606060;"&gt;  17:&lt;/span&gt;         {&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum18" style="color:#606060;"&gt;  18:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (ScrollBarVisibility)o.GetValue(MyVsbvProperty);&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum19" style="color:#606060;"&gt;  19:&lt;/span&gt;         }&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum20" style="color:#606060;"&gt;  20:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum21" style="color:#606060;"&gt;  21:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; OnMyVsbvChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum22" style="color:#606060;"&gt;  22:&lt;/span&gt;         {&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum23" style="color:#606060;"&gt;  23:&lt;/span&gt;             ((TextBox)d).VerticalScrollBarVisibility = (ScrollBarVisibility)e.NewValue;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum24" style="color:#606060;"&gt;  24:&lt;/span&gt;         }&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum25" style="color:#606060;"&gt;  25:&lt;/span&gt;     }&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum26" style="color:#606060;"&gt;  26:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Very unintuitive name and my casts could be bad since there are no type checks, just an example. So here when the attached property is changed we change the property on the TextBox that the property is declared on. So if we change our style to use the attached property instead of the actual property it will work: &lt;/p&gt;
&lt;div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;width:97.5%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;cursor:text;border:silver 1px solid;padding:4px;"&gt;
&lt;div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;
&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum1" style="color:#606060;"&gt;   1:&lt;/span&gt; &amp;lt;UserControl x:Class=&lt;span style="color:#006080;"&gt;&amp;quot;Attachment.Page&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum2" style="color:#606060;"&gt;   2:&lt;/span&gt;     xmlns=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum3" style="color:#606060;"&gt;   3:&lt;/span&gt;     xmlns:x=&lt;span style="color:#006080;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum4" style="color:#606060;"&gt;   4:&lt;/span&gt;     xmlns:local=&lt;span style="color:#006080;"&gt;&amp;quot;clr-namespace:Attachment&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum5" style="color:#606060;"&gt;   5:&lt;/span&gt;     Width=&lt;span style="color:#006080;"&gt;&amp;quot;400&amp;quot;&lt;/span&gt; Height=&lt;span style="color:#006080;"&gt;&amp;quot;300&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum6" style="color:#606060;"&gt;   6:&lt;/span&gt;     &amp;lt;UserControl.Resources&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum7" style="color:#606060;"&gt;   7:&lt;/span&gt;         &amp;lt;Style TargetType=&lt;span style="color:#006080;"&gt;&amp;quot;TextBox&amp;quot;&lt;/span&gt; x:Key=&lt;span style="color:#006080;"&gt;&amp;quot;test&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum8" style="color:#606060;"&gt;   8:&lt;/span&gt;             &amp;lt;Setter Property=&lt;span style="color:#006080;"&gt;&amp;quot;FontSize&amp;quot;&lt;/span&gt; Value=&lt;span style="color:#006080;"&gt;&amp;quot;24&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum9" style="color:#606060;"&gt;   9:&lt;/span&gt;             &amp;lt;Setter Property=&lt;span style="color:#006080;"&gt;&amp;quot;local:Attachments.MyVsbv&amp;quot;&lt;/span&gt; Value=&lt;span style="color:#006080;"&gt;&amp;quot;Visible&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum10" style="color:#606060;"&gt;  10:&lt;/span&gt;         &amp;lt;/Style&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum11" style="color:#606060;"&gt;  11:&lt;/span&gt;     &amp;lt;/UserControl.Resources&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum12" style="color:#606060;"&gt;  12:&lt;/span&gt;     &amp;lt;Grid x:Name=&lt;span style="color:#006080;"&gt;&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; Background=&lt;span style="color:#006080;"&gt;&amp;quot;White&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum13" style="color:#606060;"&gt;  13:&lt;/span&gt;                 &amp;lt;TextBox Text=&lt;span style="color:#006080;"&gt;&amp;quot;This is a test&amp;quot;&lt;/span&gt; Style=&lt;span style="color:#006080;"&gt;&amp;quot;{StaticResource test}&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum14" style="color:#606060;"&gt;  14:&lt;/span&gt;             &amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;pre style="text-align:left;line-height:12pt;background-color:white;margin:0em;width:100%;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0px;"&gt;&lt;span id="lnum15" style="color:#606060;"&gt;  15:&lt;/span&gt; &amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So there you have it. If you need to style a property on a control that isn&amp;rsquo;t a dependency property you can use this method to get around that limitation. There are a bunch of other uses for this that I&amp;rsquo;ll be blogging when I have another minute. &lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=453310" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v7ExfVEDjocPnMc0A6XcG7pnOKs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v7ExfVEDjocPnMc0A6XcG7pnOKs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v7ExfVEDjocPnMc0A6XcG7pnOKs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v7ExfVEDjocPnMc0A6XcG7pnOKs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=BVPTA979hF8:yFibAHHIvZc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=BVPTA979hF8:yFibAHHIvZc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=BVPTA979hF8:yFibAHHIvZc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/BVPTA979hF8" height="1" width="1"/&gt;</description><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/18/styling-hack-using-attached-properties-in-silverlight.aspx</feedburner:origLink></item><item><title>Silverlight Streaming Utility Classes</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/qg624R3umEo/silverlight-streaming-utility-classes.aspx</link><pubDate>Wed, 11 Mar 2009 23:36:53 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:453109</guid><dc:creator>bryantlikes</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=453109</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/11/silverlight-streaming-utility-classes.aspx#comments</comments><description>&lt;p&gt;Yesterday I was working through &lt;a href="http://silverlight.net/forums/t/78284.aspx"&gt;another question in the Silverlight Forums&lt;/a&gt; about how to upload video to &lt;a href="http://silverlight.live.com"&gt;Silverlight Streaming&lt;/a&gt; via code. At first I tried to reference &lt;a href="http://www.codeplex.com/videoshow"&gt;the Video.Show application&lt;/a&gt;, but there is a lot of code there and it doesn’t help if you just want to upload a bunch of videos to the same application. So I ended up taking some of the code from Video.Show and some of the code from &lt;a href="http://msdn.microsoft.com/en-us/library/bb851621.aspx"&gt;the SDK/API&lt;/a&gt; and created a very simple Utility class to help with the process. &lt;/p&gt;  &lt;p&gt;You can &lt;a href="http://code.msdn.microsoft.com/SlStreamingUtils"&gt;download the code on the Code Gallery site&lt;/a&gt;. It is very simple in that there is no error handling and I didn’t create a Silverlight version yet. I did implement GET, POST, PUT, MKCOL, and DELETE as well as creating the functionality to package a bunch of videos into a single zip which can be posted all at once. &lt;/p&gt;  &lt;p&gt;A few examples from the code, first creating a directory and PUTting a file in it:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;WebDavClient client = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebDavClient(&lt;span class="str"&gt;&amp;quot;Your AppID&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Your Key&amp;quot;&lt;/span&gt;); 
&lt;span class="rem"&gt;// get those from http://silverlight.live.com&lt;/span&gt;
 
client.CreateFolder(&lt;span class="str"&gt;&amp;quot;MyVideos&amp;quot;&lt;/span&gt;);
client.PutFile(&lt;span class="str"&gt;&amp;quot;MyVideos&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;C:\\videos\reallyCoolVideo.wmv&amp;quot;&lt;/span&gt;);&lt;/pre&gt;


&lt;p&gt;Next, packaging up a bunch of videos and POSTing the zip as an application:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;WebDavClient client = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebDavClient(&lt;span class="str"&gt;&amp;quot;Your AppID&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Your Key&amp;quot;&lt;/span&gt;); 
&lt;span class="rem"&gt;// get those from http://silverlight.live.com&lt;/span&gt;
 
client.PackageAndPostFiles(&lt;span class="str"&gt;&amp;quot;MyVideos&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;C:\\videos\firstCoolVideo.wmv&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;C:\\videos\anothercoolVideo.wmv&amp;quot;&lt;/span&gt;);&lt;/pre&gt;


&lt;p&gt;Let me know if you’d like to see a Silverlight version (be easy to implement) or if there are any other features you’d like added. &lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="text-align:right;margin:0px;padding:4px 0px 4px 0px;"&gt;&lt;a href="http://digg.com/submit?url=http%3a%2f%2fblogs.sqlxml.org%2fbryantlikes%2farchive%2f2009%2f03%2f11%2fsilverlight-streaming-utility-classes.aspx&amp;amp;title=Silverlight+Streaming+Utility+Classes"&gt;&lt;img src="http://digg.com/img/badges/100x20-digg-button.png" width="100" height="20" alt="Digg This" title="Digg This" border="0" style="border:0;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px;padding:0px 0px 0px 0px;"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=453109" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gSJHNvHSo7MW4zbcUjamMKPl518/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gSJHNvHSo7MW4zbcUjamMKPl518/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gSJHNvHSo7MW4zbcUjamMKPl518/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gSJHNvHSo7MW4zbcUjamMKPl518/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=qg624R3umEo:aMs8nONFnT4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=qg624R3umEo:aMs8nONFnT4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=qg624R3umEo:aMs8nONFnT4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/qg624R3umEo" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/11/silverlight-streaming-utility-classes.aspx</feedburner:origLink></item><item><title>Debugging a Remotely Hosted Silverlight App</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/oxUz_nzhFxw/debugging-a-remotely-hosted-silverlight-app.aspx</link><pubDate>Tue, 10 Mar 2009 18:32:14 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:453055</guid><dc:creator>bryantlikes</dc:creator><slash:comments>13</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=453055</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/10/debugging-a-remotely-hosted-silverlight-app.aspx#comments</comments><description>&lt;p&gt;This question has come up in the &lt;a href="http://silverlight.net/forums/t/78511.aspx"&gt;forums a few times&lt;/a&gt; so I thought it would be worth a blog post. Most people are pretty familiar with debugging a Silverlight application running locally during development, but what people many times don’t realize is that you can also attach your debugger to a xap file that is hosted remotely. &lt;a href="http://msdn.microsoft.com/en-us/library/cc838267(VS.95).aspx"&gt;This MSDN article&lt;/a&gt; touches on this briefly, but doesn’t really go into details on how it works. &lt;/p&gt;  &lt;p&gt;The important thing to understand about Silverlight is that it runs the .NET code on the client machine, not on the server. The code runs in the browser process, so if you’re going to debug it you need to attach to that process. The one caveat is that the xap on the server must be the same as the compiled xap on your development machine. In other words, you can’t debug the remote xap after you’ve made changes locally and haven’t deployed them.&lt;/p&gt;  &lt;p&gt;As an example I will demonstrate remotely debugging the &lt;a href="http://www.codeplex.com/Twilight"&gt;Twilight badge&lt;/a&gt; on my blog. &lt;/p&gt;  &lt;p&gt;First I open the Twilight.sln and since I’ve made a few changes in the last week I’ll deploy the latest xap file from my project to my server at &lt;a href="http://blogs.sqlxml.org/wpfe/twilight.xap"&gt;http://blogs.sqlxml.org/wpfe/twilight.xap&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Next, now that I am sure the xap file on the server has the same code as my solution, I can set a breakpoint on Line 36 (using version 1.5.2) where the Twitter javascript callback calls into Silverlight with the latest list of tweets:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_14047933.png"&gt;&lt;img title="image" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="112" alt="image" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_thumb_5F00_0CE53CBB.png" width="531" border="0" /&gt;&lt;/a&gt; &lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Now instead of hitting F5 to start debugging my application, I’ll open a new instance of Internet Explorer (or you could use Firefox to debug that as well) and navigate to &lt;a href="http://blogs.sqlxml.org/bryantlikes"&gt;my blog&lt;/a&gt; since that is where the xap shows up. Back in Visual Studio I click Debug –&amp;gt; Attach to Process and select the iexplore.exe process which is Internet Explorer (or firefox.exe if you’re debugging Firefox). &lt;/p&gt;

&lt;p&gt;NOTE: Make sure you click highlight iexplore.exe or firefox.exe and then click the Select button and choose Silverlight as the type of code you wish to debug.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_3AD28F73.png"&gt;&lt;img title="image" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="442" alt="image" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_thumb_5F00_05C60043.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Once I click attach I can go back to my Internet Explorer window and hit refresh to force the breakpoint to get hit. If everything was setup correctly you should get taken back to Visual Studio where your breakpoint is highlighted and you can now step through your Silverlight code.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_33B352FB.png"&gt;&lt;img title="image" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="105" alt="image" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/image_5F00_thumb_5F00_61A0A5B3.png" width="555" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So why is this useful? Well a lot can change in your application when you start hosting it on a real server instead of in your localhost. For one, you now have to access services running on the server and you are subject to a lot more security checks that were ignored on your localhost. So I find this to be a useful tool for troubleshooting things when they work locally but break once I deploy out to a server.&lt;/p&gt;

&lt;p&gt;One last thing, you can also set this up to &lt;a href="http://msdn.microsoft.com/en-us/library/cc903948(VS.95).aspx"&gt;remotely debug code running on the Mac&lt;/a&gt;. &lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="text-align:right;margin:0px;padding:4px 0px 4px 0px;"&gt;&lt;a href="http://digg.com/submit?url=http%3a%2f%2fblogs.sqlxml.org%2fbryantlikes%2farchive%2f2009%2f03%2f10%2fdebugging-a-remotely-hosted-silverlight-app.aspx&amp;amp;title=Debugging+a+Remotely+Hosted+Silverlight+App"&gt;&lt;img src="http://digg.com/img/badges/100x20-digg-button.png" width="100" height="20" alt="Digg This" title="Digg This" border="0" style="border:0;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px;padding:0px 0px 0px 0px;"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=453055" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5gKrogXqrVUPm2PEQE3RP7ldVZI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5gKrogXqrVUPm2PEQE3RP7ldVZI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5gKrogXqrVUPm2PEQE3RP7ldVZI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5gKrogXqrVUPm2PEQE3RP7ldVZI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=oxUz_nzhFxw:jRjMKQvGmc0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=oxUz_nzhFxw:jRjMKQvGmc0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=oxUz_nzhFxw:jRjMKQvGmc0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/oxUz_nzhFxw" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/03/10/debugging-a-remotely-hosted-silverlight-app.aspx</feedburner:origLink></item><item><title>Twilight 1.5: Multiple Views with MVVM</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/WE4eZtEkPJw/twilight-1-5-multiple-views-with-mvvm.aspx</link><pubDate>Thu, 26 Feb 2009 19:15:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:452581</guid><dc:creator>bryantlikes</dc:creator><slash:comments>10</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=452581</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/26/twilight-1-5-multiple-views-with-mvvm.aspx#comments</comments><description>&lt;p&gt;You may have noticed the new look for the &lt;a href="http://www.codeplex.com/Twilight"&gt;Twilight Twitter Badge&lt;/a&gt; on my blog a few weeks ago. I wanted to add a few new looks for the badge and got one of them done but then decided I need to spend some more time on it before releasing it because I didn&amp;rsquo;t like the way the code was turning out. There were a couple of things I didn&amp;rsquo;t like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The code was too tightly coupled to the views/skins. This made it hard to add new views/skins without duplicating code. &lt;/li&gt;
&lt;li&gt;The views/skins weren&amp;rsquo;t &lt;a href="http://alanle.com/?p=110"&gt;blendable&lt;/a&gt; at all. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To start my rework I began with &lt;a href="http://blogs.msdn.com/expression/archive/2008/10/27/simulating-sample-data-in-blend-2-sp1.aspx"&gt;this post by the Expression Blend/Design team on simulating sample data in Blend&lt;/a&gt;. The post is a very simple yet workable solution for displaying design time data in Blend so that you can work on the layout of your application. The only change I made was &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2009/02/25/detecting-design-mode-in-silverlight.aspx"&gt;how I detected design mode&lt;/a&gt;. After playing around with that sample I decided that to implement this in Twilight I would need to switch to a &lt;a href="http://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx"&gt;Model-View-ViewModel&lt;/a&gt; approach so I started doing some research into using this approach with Silverlight. In my research I came across &lt;a href="http://www.ryankeeter.com/silverlight/silverlight-mvvm-pt-1-hello-world-style/"&gt;this post by Ryan Keeter&lt;/a&gt; on using MVVM in Silverlight. It was a nice simple explanation that made sense to me so I set out to combine the expression team example and this MVVM example. &lt;/p&gt;
&lt;p&gt;What I ended up with is pretty close to MVVM. I say pretty close because I don&amp;rsquo;t think it fully fits since the ViewModels hook into some of the Views Storyboard events and also control the Views VisualState transitions. Maybe that fits into MVVM, but it probably breaks some of the rules. However, for this tiny application it makes things a lot easier. I still have multiple Views per ViewModel and the Views have zero code which is what I really wanted. &lt;/p&gt;
&lt;p&gt;There are two ViewModels that I&amp;rsquo;m using: ListViewModel and RotatingViewModel. Then on top of these two ViewModels are four Views: Default, Large, Small, and Tiny. &lt;/p&gt;
&lt;table border="0" width="400" cellpadding="2" cellspacing="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;ListViewModel Views&lt;/td&gt;
&lt;td width="200" valign="top"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Twilight&amp;amp;DownloadId=56287" alt="" /&gt; &lt;/td&gt;
&lt;td width="200" valign="top"&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Twilight&amp;amp;DownloadId=59808" alt="" /&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;
&lt;p align="center"&gt;Default View&lt;/p&gt;
&lt;/td&gt;
&lt;td width="200" valign="top"&gt;
&lt;p align="center"&gt;Large View&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The ListViewModel is for views where there is just a list of tweets while the RotatingViewModel is for views that display a single tweet at a time. &lt;/p&gt;
&lt;table border="0" width="400" cellpadding="2" cellspacing="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;RotatingViewModel Views&lt;/td&gt;
&lt;td width="200" valign="top"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Twilight&amp;amp;DownloadId=56691" alt="" /&gt; &lt;/td&gt;
&lt;td width="200" valign="top"&gt;&lt;img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=Twilight&amp;amp;DownloadId=59807" alt="" /&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="200" valign="top"&gt;
&lt;p align="center"&gt;Small&lt;/p&gt;
&lt;/td&gt;
&lt;td width="200" valign="top"&gt;
&lt;p align="center"&gt;Tiny&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can switch between these views by setting the mode initParam equal to the view you want (example: mode=tiny). The Tiny view looks like the twitter counter badge but then pops the bubbles over the surrounding content. This is done using the windowless = true parameter and absolute positioning. Right now the Silverlight will float over the content below it even when the bubble isn&amp;rsquo;t showing, so you won&amp;rsquo;t be able to click through to that content. I might be able to figure out a better way to handle it, but for now that is a known limitation. &lt;/p&gt;
&lt;p&gt;Since now all the view logic is in the ViewModel, writing tests is a lot easier. I&amp;rsquo;m still using the same Silverlight test framework, but thanks to &lt;a href="http://silverlight.net/blogs/justinangel/archive/2009/02/25/silverlight-unit-testing-rhinomocks-unity-and-resharper.aspx"&gt;this post by Justin Angel I added a few more complex tests using his WaitFor extension&lt;/a&gt;. The test coverage is still very light and I&amp;rsquo;m not testing the views at all, but I feel like I&amp;rsquo;m starting to get testing in Silverlight. &lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve also added another option for hosting Twilight on your blog. You can now host it via Silverlight Streaming using an iframe. Add the following HTML to your page: &lt;/p&gt;
&lt;p&gt;&amp;lt;iframe src=&amp;quot;http://silverlight.services.live.com/invoke/232/Twilight1.5/iframe.html?username=[your username]&amp;amp;count=10&amp;amp;mode=small&amp;quot; scrolling=&amp;quot;no&amp;quot; frameborder=&amp;quot;0&amp;quot; style=&amp;#39;width:200px; height:175px&amp;#39;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/p&gt;
&lt;p&gt;** Hosting it via Silverlight Streaming doesn&amp;rsquo;t support the Tiny mode since the Silverlight won&amp;rsquo;t be able to expand outside of the iframe. &lt;/p&gt;
&lt;p&gt;In addition to hosting it via Silverlight Streaming, you can always self-host it or use the xap I have hosted on dreamhost at &lt;a href="http://twilight.bryantlikes.com/twilight.xap"&gt;http://twilight.bryantlikes.com/twilight.xap&lt;/a&gt;. If you&amp;rsquo;re already using the hosted version, you can switch the mode by using the mode initParam as I mentioned above. &lt;/p&gt;
&lt;p&gt;Hopefully this will serve as a great twitter badge for your blog and also a decent example of MVVM in Silverlight along with some unit testing examples as well. Feel free to &lt;a href="http://www.codeplex.com/Twilight"&gt;join the project on Codeplex&lt;/a&gt; and create your own views. I am still working on at least one more version that will make the colors tweakable and maybe even detect what colors should be used based on the surrounding html. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=452581" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cAooPzqHaslB-PqkIFLnYfKRQb0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cAooPzqHaslB-PqkIFLnYfKRQb0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cAooPzqHaslB-PqkIFLnYfKRQb0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cAooPzqHaslB-PqkIFLnYfKRQb0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=WE4eZtEkPJw:0B_wfpav3c4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BryantLikesBlog?a=WE4eZtEkPJw:0B_wfpav3c4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BryantLikesBlog?i=WE4eZtEkPJw:0B_wfpav3c4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/WE4eZtEkPJw" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/UX/default.aspx">UX</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Twitter/default.aspx">Twitter</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/26/twilight-1-5-multiple-views-with-mvvm.aspx</feedburner:origLink></item><item><title>Detecting Design Mode in Silverlight</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/l9EdiP1fl1c/detecting-design-mode-in-silverlight.aspx</link><pubDate>Wed, 25 Feb 2009 17:46:32 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:452526</guid><dc:creator>bryantlikes</dc:creator><slash:comments>32</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=452526</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/25/detecting-design-mode-in-silverlight.aspx#comments</comments><description>&lt;p&gt;One of the things I’ve been trying to getting a better understanding of is how to make the Silverlight projects I work on more &lt;a href="http://twitter.com/a7an/status/1215936431"&gt;blendable&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In general, WPF and Silverlight controls should be &amp;quot;blendable&amp;quot;. ItemsControls need to display representative data within the design surface.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The problem, at least for me, is that every &lt;a href="http://alanle.com/wp-trackback.php?p=110"&gt;example out there to detect design mode&lt;/a&gt; uses:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;var designMode = !HtmlPage.IsEnabled;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Since the Html Bridge is disable inside of Blend, this does work for the most part, but what about when your xap is hosted on another server? In this case the Html Bridge is disabled by default so if someone doesn’t configure it correctly they will get your design time data.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;strong&gt;Mode&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="200"&gt;&lt;strong&gt;HtmlPage.IsEnabled&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Blend&lt;/td&gt;        &lt;td valign="top" width="200"&gt;false&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Visual Studio&lt;/td&gt;        &lt;td valign="top" width="200"&gt;false&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Local Xap&lt;/td&gt;        &lt;td valign="top" width="200"&gt;true&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Remote Xap&lt;/td&gt;        &lt;td valign="top" width="200"&gt;false*&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Streaming Silverlight&lt;/td&gt;        &lt;td valign="top" width="200"&gt;true**&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;* This can be changed to true, but it is &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.interop.settings.enablehtmlaccess(VS.95).aspx"&gt;disabled by default&lt;/a&gt;.     &lt;br /&gt;** Enabled by default&lt;/p&gt;  &lt;p&gt;So I was trying to come up with another method to detect design mode in Silverlight and here is the best I have come up with so far:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsDesignTime()
{
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        var host = Application.Current.Host.Source;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    }
    &lt;span class="kwrd"&gt;catch&lt;/span&gt;
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;
    }
}&lt;/pre&gt;

&lt;p&gt;What happens is that Application.Current.Host.Source works great when the plugin is hosted in a web page and will return the path to the xap file, but in design mode trying to access that property throws an exception. So if you hit the exception then you’re in design mode, otherwise you’re in a web page. Not super elegant but it feels better to me than checking if the Html Bridge is enabled since that isn’t a true check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;As Tom mentions in the comments, you can also use DesignerProperties.GetIsInDesignMode. But if your goal is to make your project more blendable then Visual Studio support might not be important. &lt;/p&gt;

&lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;&lt;strong&gt;Mode&lt;/strong&gt;&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;&lt;strong&gt;DesignerProperties.GetIsInDesignMode&lt;/strong&gt;&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;Blend&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;true&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;Visual Studio&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;false&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;Local Xap&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;false&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;Remote Xap&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;false&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="200"&gt;Streaming Silverlight&lt;/td&gt;

      &lt;td valign="top" width="200"&gt;false&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;So with this check worst case you get no data in the Visual Studio designer, but the Visual Studio designer isn’t that great anyway. Blend is the real goal. So instead instead of the above code you can use this code instead:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsDesignTime()
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; DesignerProperties.GetIsInDesignMode(Application.Current.RootVisual);
}&lt;/pre&gt;

&lt;p&gt;Thanks for the tip Tom!&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="text-align:right;margin:0px;padding:4px 0px 4px 0px;"&gt;&lt;a href="http://digg.com/submit?url=http%3a%2f%2fblogs.sqlxml.org%2fbryantlikes%2farchive%2f2009%2f02%2f25%2fdetecting-design-mode-in-silverlight.aspx&amp;amp;title=Detecting+Design+Mode+in+Silverlight"&gt;&lt;img src="http://digg.com/img/badges/100x20-digg-button.png" width="100" height="20" alt="Digg This" title="Digg This" border="0" style="border:0;" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px;padding:0px 0px 0px 0px;"&gt;This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by/3.0/"&gt;Creative Commons Attribution By license.&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=452526" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oXiMer80PakkxcS7Tzz7y4MqVi4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oXiMer80PakkxcS7Tzz7y4MqVi4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oXiMer80PakkxcS7Tzz7y4MqVi4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oXiMer80PakkxcS7Tzz7y4MqVi4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=XESQnw37"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=tAQOAP6U"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=tAQOAP6U" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/l9EdiP1fl1c" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/25/detecting-design-mode-in-silverlight.aspx</feedburner:origLink></item><item><title>Running a Home Office Web Server with a Dynamic IP</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/SNRjltopRAM/running-a-home-office-web-server-with-a-dynamic-ip.aspx</link><pubDate>Tue, 10 Feb 2009 18:19:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:451824</guid><dc:creator>bryantlikes</dc:creator><slash:comments>7</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=451824</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/10/running-a-home-office-web-server-with-a-dynamic-ip.aspx#comments</comments><description>&lt;p&gt;I&amp;rsquo;ve blogged about &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2005/04/25/3019.aspx"&gt;my server closet in my home office&lt;/a&gt; before. I used to have three servers running in my home office and for Internet service I had AT&amp;amp;T DSL with 5 static IP addresses. That all changed by accident when I was looking into current pricing and found I could upgrade my speed and I would get a lower cost. However, someone over at AT&amp;amp;T DSL misread my order and changed me from static to dynamic, so yesterday morning I got knocked offline. I spent over 2 hours on the phone with them and they told me it could take up to 48 hours before they could get me static IP addresses again. So I started looking into getting my blog back online with a dynamic IP.&lt;/p&gt;
&lt;p&gt;One of my goals for last year was to outsource most of my home network to external servers because I didn&amp;rsquo;t like dealing with it. So last year I did outsource email to &lt;a href="http://www.google.com/a/cpanel/domain/new"&gt;Google Apps&lt;/a&gt;, DNS and some websites to &lt;a href="http://www.godaddy.com/"&gt;Godaddy&lt;/a&gt;, and Subversion to &lt;a href="http://www.dreamhost.com"&gt;Dreamhost&lt;/a&gt;. Because of that I was able to downsize to a single server which I run a few websites on. I also had been having network speed issues so I had just purchased a new router+dsl modem, the &lt;a href="http://www.amazon.com/D-Link-DSL-2540B-4-Port-Ethernet-Router/dp/B000O0XW7E/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=electronics&amp;amp;qid=1234288874&amp;amp;sr=8-1"&gt;D-Link DSL 2540B&lt;/a&gt; which happens to support Dynamic DNS.&lt;/p&gt;
&lt;p&gt;Setting it up:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You need to make sure your router supports Dynamic DNS and you need an account with a Dynamic DNS service. I used &lt;a href="http://www.dyndns.com/"&gt;dyndns.com&lt;/a&gt; since they have free accounts. I setup mine to be bryantlikes.dyndns.org. &lt;/li&gt;
&lt;li&gt;Delete the A record for your DNS (if you have one) and then create a new CNAME for your domain that points to the Dynamic DNS name. So, for example, blogs.sqlxml.org has a CNAME that points to bryantlikes.dyndns.org. If you have other CNAME records already (for example, www), then point those to your dynamic DNS entry as well.&lt;/li&gt;
&lt;li&gt;Forward port 80 to your web server in your router settings. This is different for each router, D-Link calls it Virtual Servers under the advanced tab.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;At this point your website should be available from the Internet. However, internally you won&amp;rsquo;t be able to hit it. The port forwarding only happens from the WAN interface and not the LAN one. In order to get it working internally you have to take a couple more steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setup DNS on your web server if it isn&amp;rsquo;t already on there. Then add a new domain for the domain that you used in your dynamic DNS. For example, I added the bryantlikes.dyndns.org domain and then created an A record for the root that points to my web server&amp;rsquo;s local IP address. &lt;/li&gt;
&lt;li&gt;Make sure your DHCP clients all point to your web server as their DNS. It is the only DNS Server that redirects the dynamic DNS entry to your local server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&amp;rsquo;s it! You should now have your dynamic IP serving up web pages both internally and externally. This caused me a bunch of headaches and googling yesterday so I thought it was worth blogging about. I glossed over lots of setup in each of the steps so if you want more information let me know and I&amp;rsquo;ll try to add it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=451824" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AJF4ptNpeOSucmFS7cIb_xgMF8M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AJF4ptNpeOSucmFS7cIb_xgMF8M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AJF4ptNpeOSucmFS7cIb_xgMF8M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AJF4ptNpeOSucmFS7cIb_xgMF8M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=NYvKE2ww"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=tpaqnmAj"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=tpaqnmAj" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/SNRjltopRAM" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/General/default.aspx">General</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Community+Server/default.aspx">Community Server</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/10/running-a-home-office-web-server-with-a-dynamic-ip.aspx</feedburner:origLink></item><item><title>A Year of Climbing Mountains</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/C8_PmAoY2vQ/a-year-of-climbing-mountains.aspx</link><pubDate>Wed, 04 Feb 2009 19:54:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:451600</guid><dc:creator>bryantlikes</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=451600</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/04/a-year-of-climbing-mountains.aspx#comments</comments><description>&lt;p&gt;This post is actually about cycling more than coding, but as I thought about it I realized that being a Software Developer is often much like mountain climbing. Each time I get to what I think is the peak (or close to the peak) I see that there is another even higher peak up ahead. For instance, I&amp;rsquo;m finally getting comfortable with Silverlight 2 and just starting to get a glimpse of Silverlight 3. A Software Developer can never stop learning (especially if you&amp;rsquo;re a web developer). I still remember my first glimpse of the .NET/FX mountain range at PDC 05 which we now know to have peaks such as WPF, WCF, and even Silverlight. It was very overwhelming at the time, but now it is fun to look back at where I was then. Quite a view from up here. With all the new stuff coming this year, Win7, Silverlight 3, VS 2010 (betas at least), it will be a year of climbing for sure.&lt;/p&gt;
&lt;p&gt;But the real climbing that inspired this post is climbing on my bike. Last year I got serious about riding my bike and did three big rides: 62.5 mile ADA Ride, 100 mile Coolbreeze Century, and the 175 mile MS Socal Ride. At the start of the season I rode mostly flats with a few hills but pretty much hated climbing. During the ADA ride I kept up with a pack of riders that were much faster than me but I would quickly get dropped every time we hit any kind of a climb. After that I started riding Rockstore once a week during the &lt;a href="http://www.winswheels.com"&gt;Wins Wheels&lt;/a&gt; shop ride and would ride Santa Susana once or twice a week. I did enough climbing prior to my century that I didn&amp;rsquo;t get passed a single time on any climbs and I was the one dropping the pack. On the MS ride I did get passed on one climb (by a girl), but that was because I was resting the in the shade so that I didn&amp;rsquo;t pass out from heat exhaustion. :)&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve actually started to enjoy climbing and so this year I&amp;rsquo;m planning on doing two rides: &lt;a href="http://www.cvcbike.org/cruisin/"&gt;Cruising the Conejo&lt;/a&gt; and &lt;a href="http://www.ocw.org/bear/bearinfo.asp"&gt;Ride Around the Bear&lt;/a&gt;. Both are century rides, but both have a lot of climbing. Cruising the Conejo has 6,000 feet of climbing while Ride Around the Bear has 10,000 feet of climbing. I just started to train for them in earnest this week and sometimes I wonder if I&amp;rsquo;m crazy to attempt these rides. Right now I know I couldn&amp;rsquo;t do it, but that is how you get to a place you want to be. You plan to get there at a later date and set that date in stone, otherwise you&amp;rsquo;ll never get there. &lt;/p&gt;
&lt;p&gt;So this year is a year of climbing for me, both in cycling and in software. Hope to see you on one of the peaks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=451600" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XeLAR_iQQxQbyYp_CO92IepZTZc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XeLAR_iQQxQbyYp_CO92IepZTZc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XeLAR_iQQxQbyYp_CO92IepZTZc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XeLAR_iQQxQbyYp_CO92IepZTZc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=0mRN0W6P"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=XLw5Le8G"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=XLw5Le8G" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/C8_PmAoY2vQ" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/General/default.aspx">General</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Cycling/default.aspx">Cycling</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/02/04/a-year-of-climbing-mountains.aspx</feedburner:origLink></item><item><title>Twilight 1.1: Using a Yahoo Pipes Proxy</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/hXNLzAcFO3I/twilight-1-1-using-a-yahoo-pipes-proxy.aspx</link><pubDate>Tue, 27 Jan 2009 22:54:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:451318</guid><dc:creator>bryantlikes</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=451318</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/27/twilight-1-1-using-a-yahoo-pipes-proxy.aspx#comments</comments><description>&lt;p&gt;I just pushed a minor update to &lt;a href="http://www.codeplex.com/Twilight"&gt;Twilight that you can now download on the codeplex site&lt;/a&gt; (version 1.1). I really wanted to allow the xap file to be hosted on other servers since many bloggers don&amp;rsquo;t have the ability to host their own xap files. After reading &lt;a href="http://blogs.msdn.com/msmossyblog/archive/2009/01/26/replaced-my-msdn-graphic-header-with-silverlight.aspx"&gt;Scott Barnes&amp;rsquo; post about replacing his header with Silverlight&lt;/a&gt; I decided I would take a similar approach. Instead of using a callback or trying to get the data directly, Scott followed &lt;a href="http://jonas.follesoe.no/PermaLink,guid,52d330a9-2931-40dc-9320-01195b24996a.aspx"&gt;Jonas&amp;rsquo; post on using Yahoo Pipes to proxy data to Silverlight&lt;/a&gt;. I took the same approach and during the process refactored some of the code by moving all the data logic out to a separate set of classes. Now when the xap loads it checks to see if it can access the Html Bridge and makes sure it is on the same domain. If it is then it will just use the standard Twitter callback method, otherwise it uses the &lt;a href="http://pipes.yahoo.com/pipes/pipe.info?_id=bmyAAovs3RGkGYkMBRNMsA"&gt;yahoo pipes proxy&lt;/a&gt; I created.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/pipes_5F00_32F68400.png"&gt;&lt;img border="0" align="left" width="244" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/pipes_5F00_thumb_5F00_64F0B53B.png" alt="pipes" height="184" title="pipes" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The pipe I created simple takes a username and the number of tweets to return and grabs the twitter xml. I then use an HttpRequest in my code to get this xml from yahoo formatted as json which matches up to the json that I was getting from Twitter with the exception that there are a few wrapper objects I have to go through to get the tweets. I also moved all the update logic out of the page class and into the base data provider class since that made a lot more sense.&lt;/p&gt;
&lt;p&gt;I think the new code makes it much cleaner and the end result is you can now just stick the object tag up on your blog and leave the xap hosted on my server if you&amp;rsquo;d like. Here is the html you can use for the hosted version:&lt;/p&gt;
&lt;p&gt;&amp;lt;div id=&amp;quot;silverlightControlHost&amp;quot;&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;object id=&amp;quot;TwitterBadge&amp;quot; data=&amp;quot;data:application/x-silverlight-2,&amp;quot; type=&amp;quot;application/x-silverlight-2&amp;quot; width=&amp;quot;200&amp;quot; height=&amp;quot;400&amp;quot;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name=&amp;quot;source&amp;quot; value=&amp;quot;http://twilight.bryantlikes.com/Twilight.xap&amp;quot;/&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name=&amp;quot;minRuntimeVersion&amp;quot; value=&amp;quot;2.0.31005.0&amp;quot; /&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name=&amp;quot;initParams&amp;quot; value=&amp;quot;username=&lt;b&gt;bryantlikes&lt;/b&gt;,count=10&amp;quot; /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div style=&amp;#39;position:relative;&amp;#39;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a style=&amp;#39;z-index:0;&amp;#39; href=&amp;#39;http://go.microsoft.com/fwlink/?LinkID=124807&amp;#39; style=&amp;#39;text-decoration: none;&amp;#39;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;img src=&amp;quot;http://twilight.bryantlikes.com/twilightNoSilverlight.png&amp;quot; alt=&amp;quot;Get Microsoft Silverlight&amp;quot; style=&amp;#39;border-style: none&amp;#39;/&amp;gt; &amp;lt;/a&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div style=&amp;#39;font-family:Arial;font-size:10px;position:absolute;top:230;left:10;width:175px;&amp;#39;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by clicking &amp;quot;Install Microsoft Silverlight&amp;quot; you accept the &amp;lt;br /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&amp;quot;http://www.microsoft.com/silverlight/resources/License.aspx?v=2.0&amp;quot;&amp;gt;Silverlight license agreement&amp;lt;/a&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;/object&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;iframe style=&amp;#39;visibility:hidden;height:0;width:0;border:0px&amp;#39;&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;/iframe&amp;gt; &lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;Today I had my first sighting of &lt;a href="http://blog.dennyboynton.com/default.aspx"&gt;Twilight in the wild over at Denny Boynton&amp;rsquo;s Blog&lt;/a&gt;.&amp;nbsp; Very cool!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=451318" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-fwakbbFUyDxCMJfLQ0o6cPwsXo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-fwakbbFUyDxCMJfLQ0o6cPwsXo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-fwakbbFUyDxCMJfLQ0o6cPwsXo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-fwakbbFUyDxCMJfLQ0o6cPwsXo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=VmK9iHYE"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=dHxnpmPK"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=dHxnpmPK" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/hXNLzAcFO3I" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Twitter/default.aspx">Twitter</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/27/twilight-1-1-using-a-yahoo-pipes-proxy.aspx</feedburner:origLink></item><item><title>Twilight Source Code Published</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/boYHmdoybbw/twilight-source-code-published.aspx</link><pubDate>Tue, 27 Jan 2009 02:21:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:451249</guid><dc:creator>bryantlikes</dc:creator><slash:comments>6</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=451249</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/26/twilight-source-code-published.aspx#comments</comments><description>&lt;p&gt;This afternoon I put &lt;a href="http://www.codeplex.com/Twilight"&gt;the Twilight source code up on CodePlex&lt;/a&gt;. &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2009/01/23/twilight-a-silverlight-twitter-badge.aspx"&gt;Twilight is the Silverlight Twitter Badge&lt;/a&gt; that I created from my &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/mix-10k-challenge-entry.aspx"&gt;AgFeedReader Mix 10k contest entry&lt;/a&gt;. You can download the source and I also &lt;a href="http://www.codeplex.com/Twilight/Release/ProjectReleases.aspx?ReleaseId=22307"&gt;packaged up the Xap file along with support files&lt;/a&gt; if you don’t want to bother with the code. &lt;/p&gt;  &lt;p&gt;I haven’t been able to get it to work when the xap isn’t hosted on the same server as the page itself, so for now there is no hosted scenario. Perhaps I’ll have to create some other proxy &lt;a href="http://www.codeplex.com/silvester"&gt;like Silvester uses&lt;/a&gt;. If you have any good ideas feel free to suggest them or better yet contribute to the project.&lt;/p&gt;  &lt;p&gt;In my previous post on the subject I wrote that I was using &lt;a href="http://www.codeplex.com/SilverlightLinkLabel"&gt;the LinkLabel control&lt;/a&gt; to create the text with the linked embedded in it. There was also an external WrapPanel control that came with the LinkLabel source. However, in the end I switched to using a custom wrap panel that was based on the &lt;a&gt;Silverlight Toolkit WrapPanel&lt;/a&gt; but was a much lighter version (I only need horizontal wrapping). I also found another issue with the LinkLabel control and after spending some time trying to fix it I decided that it also was overkill for what I needed. So while I used some of the same ideas I ended up writing some new code to handle this (I did credit both of these projects in both the source code and on the codeplex page). &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/Tests_5F00_4F40C3FD.png"&gt;&lt;img title="Tests" height="408" alt="Tests" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/Tests_5F00_thumb_5F00_47B7E541.png" width="277" align="right" border="0" /&gt;&lt;/a&gt;I also gave &lt;a href="http://code.msdn.microsoft.com/silverlightut"&gt;the Silverlight Unit Test Framework&lt;/a&gt; a try and the source code includes a test project. This was my first real experience with the framework and I definitely found it very useful. If you haven’t used it before I highly recommend &lt;a href="http://www.jeff.wilcox.name/2008/03/silverlight2-unit-testing/"&gt;Jeff Wilcox’s introduction post on the framework&lt;/a&gt;. It was very easy to use and I actually found a few bugs in my code through my tests (I didn’t do full TDD on this project but next time I think I will). &lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/Tests_5F00_4F40C3FD.png"&gt;&lt;/a&gt;When you run the test project it loads up right in the browser and runs the tests. I didn’t do very much UI testing, but I did test my wrap panel implementation by using the TestPanel that is part of the framework. That allowed me add TextBlocks and measure their size to determine how big my panel should be. Then I added an instance of my panel to the TestPanel to test it. This feature is very nice since measuring doesn’t work right unless the child is actually in the control tree, that that alone makes the test framework worthwhile. Even better was the fact that I didn’t have to modify a single line of code in my real project in order to allow the test framework to work. Well done!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/exampleNoSl_5F00_1241B3CD.png"&gt;&lt;img title="exampleNoSl" height="244" alt="exampleNoSl" src="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/exampleNoSl_5F00_thumb_5F00_769FB887.png" width="160" align="left" border="0" /&gt;&lt;/a&gt; I also did some work to create a decent install experience after reading &lt;a href="http://timheuer.com/blog/archive/2008/03/25/creating-a-great-silverlight-deployment-experience.aspx"&gt;Tim Heuer’s&lt;/a&gt; &lt;a href="http://timheuer.com/blog/archive/2008/12/02/silverlight-install-experience-best-practices-netflix.aspx"&gt;several&lt;/a&gt; &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=57016"&gt;posts&lt;/a&gt; &lt;a href="http://timheuer.com/blog/archive/2008/09/08/silverlight-install-experience-too-hard.aspx"&gt;on the subject&lt;/a&gt;. If you don’t have Silverlight installed you will get an image that looks like the actual application but has a prompt to install Silverlight. I didn’t spend much time on this part, but it is a lot better than the big giant button you normally would get. &lt;/p&gt;  &lt;p&gt;There is still lots of room for improvement and I would like to figure out the remote hosting option as well as create some cool animation for loading. But for now it is a very light weight (13k) Silverlight Twitter Badge.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=451249" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aC-nJh4wVEg_m07INvnwUqTGQhM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aC-nJh4wVEg_m07INvnwUqTGQhM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aC-nJh4wVEg_m07INvnwUqTGQhM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aC-nJh4wVEg_m07INvnwUqTGQhM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=D9Gf9vwv"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=qrApnPOI"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=qrApnPOI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/boYHmdoybbw" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Twitter/default.aspx">Twitter</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/26/twilight-source-code-published.aspx</feedburner:origLink></item><item><title>Twilight: A Silverlight Twitter Badge</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/i-9AC9FGnGE/twilight-a-silverlight-twitter-badge.aspx</link><pubDate>Sat, 24 Jan 2009 06:27:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:451136</guid><dc:creator>bryantlikes</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=451136</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/23/twilight-a-silverlight-twitter-badge.aspx#comments</comments><description>&lt;p&gt;When &lt;a href="http://www.twitter.com"&gt;Twitter&lt;/a&gt; first came out I signed up but never really caught on until recently. I finally figured out that you really need to follow some people first to get the hang of it. Now I enjoy using Twitter and read peoples tweets using &lt;a href="http://code.google.com/p/wittytwitter/"&gt;Witty, a WPF Twitter client&lt;/a&gt;. Even though I only have a few followers, it still feels like you&amp;rsquo;re part of a bigger conversation since your own posts get mixed in with the posts of people you&amp;rsquo;re following.&lt;/p&gt;
&lt;p&gt;So now that I&amp;rsquo;m using Twitter I wanted to put my latest tweets on my blog. Twitter provides a flash based Twitter badge and an HTML version as well, but since I&amp;rsquo;m a Silverlight developer I thought it would be cool to use Silverlight. I came across &lt;a href="http://www.silverlightshow.net/items/Silvester-A-Silverlight-Twitter-Widget.aspx"&gt;Silvester which is a Silverlight Twitter Widget&lt;/a&gt; and looks great, but I wanted to create a widget/badge that didn&amp;rsquo;t require a proxy server. &lt;/p&gt;
&lt;p&gt;&lt;img align="right" src="http://2009.visitmix.com/10k/Approved/Submission0029/thumbnail.png" style="display:inline;margin-left:0px;margin-right:0px;" alt="" /&gt; &lt;/p&gt;
&lt;p&gt;For &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/mix-10k-challenge-entry.aspx"&gt;my entry in the MIX 10K contest&lt;/a&gt; I created a Silverlight feed reader that would allow you to subscribe to a bunch of feeds and it would keep them updated and stored your subscriptions in isolated storage. Since you can&amp;rsquo;t actually access most feeds directly (unless the host has a client access file which most don&amp;rsquo;t) I used the &lt;a href="http://code.google.com/apis/ajaxfeeds/"&gt;Google Ajax Feed proxy&lt;/a&gt; to grab all my feeds. This worked great because Google has a client access policy that allows you to get the content plus it puts it all into a single format and returns it as json. All I had to do was generate classes in my application to mirror the object structure of the json and then use a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer(VS.95).aspx"&gt;DataContractJsonSerializer&lt;/a&gt; to deserialize the json into objects. &lt;/p&gt;
&lt;p&gt;So when I started on my Twitter badge I basically took the AgFeedReader project and removed the isolated storage and the feed subscription interface. I really only needed a single feed which I would set using an &lt;a href="http://msdn.microsoft.com/en-us/library/cc189004(VS.95).aspx"&gt;InitParam&lt;/a&gt;. I was able to get my twitter feed using the Google Ajax Feed Proxy, but that proxy only returns the last four items from the feed and omits a lot of the rich data that Twitter provides. So I decided to try another approach.&lt;/p&gt;
&lt;p&gt;I started by looking at the script that is part of the Twitter HTML badge. The key was the script they provide to get the feeds which includes a callback parameter. You call the json script and add a callback=YourJavascriptFunction. So in my Silverlight application I add two scripts to the page: the first is the Twitter Json script and the second is a stub javascript function that calls back into my Silverlight application. This gets around the security issue which prevents you from downloading the json directly.&lt;/p&gt;
&lt;p&gt;Now back in my Silverlight application I get passed in a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptobject(VS.95).aspx"&gt;ScriptObject&lt;/a&gt; which is the json. This ScriptObject is really just an array of Tweets, but since it is an array I actually have to manually convert it to my .Net objects. There is a &lt;a href="http://msdn.microsoft.com/en-us/library/cc645079(VS.95).aspx"&gt;good MSDN page here&lt;/a&gt; that describes all the rules for the interop between javascript objects and .Net objects. Below is my method that gets called from BLOCKED SCRIPT&lt;/p&gt;
&lt;div style="font-size:12pt;background:#181818;color:#e0e0e0;font-family:consolas;"&gt;
&lt;p style="margin:0px;"&gt;[&lt;span style="color:#c7c7f1;"&gt;ScriptableMember&lt;/span&gt;]&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;void&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;TwitterCallback&lt;/span&gt;(&lt;span style="color:#c7c7f1;"&gt;ScriptObject&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;json&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#fef1a9;"&gt;twitList&lt;/span&gt;.&lt;span style="color:#fef1a9;"&gt;ItemsSource&lt;/span&gt; = &lt;span style="color:#fef1a9;"&gt;json&lt;/span&gt;.&lt;span style="color:#fef1a9;"&gt;ConvertTo&lt;/span&gt;&amp;lt;&lt;span style="color:#c7c7f1;"&gt;Tweet&lt;/span&gt;[]&amp;gt;();&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The twitList is my ListBox and the Tweet class is a .Net class that I created that mirrors the json returned by Twitter. &lt;/p&gt;
&lt;p&gt;In order to display the Tweets I wanted to not just have text but have clickable links. The Silvester Twitter Gadget has a very nice &lt;a href="http://www.silverlightshow.net/items/Silverlight-LinkLabel-control.aspx"&gt;LinkLabel control&lt;/a&gt; that will allow you to have a text area with clickable links. So instead of reinventing the wheel I just used that in place of my normal TextBlocks from the AgFeedReader project. I did change one line of code but for the most part it worked perfectly. &lt;/p&gt;
&lt;p&gt;Anyhow, it is a pretty standard Twitter Badge right now, but that is only a few hours of work and I&amp;rsquo;m hoping to add a few more features to it. I&amp;rsquo;m hoping to put the xap along with some javascript helper files up on a server somewhere so that anyone can add it to their blog, but if you&amp;rsquo;re interested let me know and I&amp;rsquo;ll try to get it done this weekend. If you&amp;rsquo;re reading this through a feed reader, head over to &lt;a href="http://blogs.sqlxml.org/bryantlikes"&gt;my blog&lt;/a&gt; and you will be able to see the Twitter Badge in action.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=451136" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7Gvex7p1FH8nXrf6qpVfkv8nDB8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Gvex7p1FH8nXrf6qpVfkv8nDB8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7Gvex7p1FH8nXrf6qpVfkv8nDB8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7Gvex7p1FH8nXrf6qpVfkv8nDB8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=QZDLq4W0"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=fzA4lyx2"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=fzA4lyx2" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/i-9AC9FGnGE" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/ASP.Net_2F00_Web+Services/default.aspx">ASP.Net/Web Services</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Twitter/default.aspx">Twitter</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2009/01/23/twilight-a-silverlight-twitter-badge.aspx</feedburner:origLink></item><item><title>Switching XAP Files on the Client Side</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/K6iP44rdaw4/switching-xap-files-on-the-client-side.aspx</link><pubDate>Tue, 23 Dec 2008 04:15:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:449931</guid><dc:creator>bryantlikes</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=449931</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/switching-xap-files-on-the-client-side.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://silverlight.net/members/qingquan126778.aspx"&gt;qingquan126778&lt;/a&gt;&amp;nbsp;&lt;a href="http://silverlight.net/forums/t/60470.aspx"&gt;asked the question&lt;/a&gt; in the Silverlight forums about how to switch between pages in Silverlight if the pages are in different xap files. First I pointed to &lt;a href="http://silverlight.net/blogs/jesseliberty/archive/2008/05/31/multi-page-applications-in-silverlight.aspx"&gt;Jesse Liberty&amp;rsquo;s post on multi-page applications&lt;/a&gt; (qinqquan wanted different xap files, not just pages) and then &lt;a href="http://silverlight.net/blogs/msnow/archive/2008/09/09/silverlight-tip-of-the-day-37-how-to-dynamically-load-and-display-silverlight-applications.aspx"&gt;Mike Snow&amp;rsquo;s post on swapping between xap files using the ASP.NET server control&lt;/a&gt; (qingquan wanted client side only). &lt;/p&gt;
&lt;p&gt;So since neither one was quite right, I coded up an example of my own that is based off Mike&amp;rsquo;s example but uses client side scripting instead of server side. Basically you grab a reference to the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.silverlightcontrols.silverlightplugin(VS.95).aspx"&gt;Silverlight plugin control&lt;/a&gt; via the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.silverlightcontrols.silverlightplugin.onload(VS.95).aspx"&gt;onLoad event&lt;/a&gt; and then just set the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.silverlightcontrols.silverlightplugin.source(VS.95).aspx"&gt;Source property&lt;/a&gt; to the new xap. &lt;/p&gt;
&lt;p&gt;function App2() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; slCtl.Source = &amp;quot;ClientBin/SilverlightApplication2.xap&amp;quot;; &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/XapSwap.zip"&gt;Download Source Here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BTW &amp;ndash; Did you vote on &lt;a href="http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0029"&gt;my 10k Content Entry&lt;/a&gt; yet? :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=449931" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ebAGTjwP6VnX1AJWi2XohOLMKvg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ebAGTjwP6VnX1AJWi2XohOLMKvg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ebAGTjwP6VnX1AJWi2XohOLMKvg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ebAGTjwP6VnX1AJWi2XohOLMKvg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=BPIeITif"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=yBlahfmB"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=yBlahfmB" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/K6iP44rdaw4" height="1" width="1"/&gt;</description><enclosure url="http://blogs.sqlxml.org/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bryantlikes/XapSwap.zip" length="76067" type="application/x-compressed" /><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/switching-xap-files-on-the-client-side.aspx</feedburner:origLink></item><item><title>MIX 10k Challenge Entry</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/HD52YSC-t4s/mix-10k-challenge-entry.aspx</link><pubDate>Mon, 22 Dec 2008 23:35:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:449920</guid><dc:creator>bryantlikes</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=449920</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/mix-10k-challenge-entry.aspx#comments</comments><description>&lt;p&gt;So my entry in the Mix 10K challenge is &lt;a href="http://2009.visitmix.com/MIXtify/TenKDisplay.aspx?SubmissionID=0029"&gt;up in the gallery&lt;/a&gt;. It was a fun little project to create and I went well over 10k many times during the project and then had to whittle it back down each time. It is a feed reader that allows you to subscribe to feeds and it stores your subscriptions in Isolated Storage. I thought it was somewhat original, but then I watched &lt;a href="http://visitmix.com/News/Countdown-to-MIX09-MIX-10K-Challenge"&gt;this video on the contest&lt;/a&gt; and Adam even mentions an RSS reader, so I guess it was little obvious. :)&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re looking to enter the contest a few good posts on the subject are &lt;a href="http://adamkinney.com/blog/390/default.aspx"&gt;Adam&amp;rsquo;s post&lt;/a&gt; and &lt;a href="http://www.bluerosegames.com/SilverlightBrassTacks/post/Thoughts-on-the-MIX-10K-challenge.aspx"&gt;Bill Reiss&amp;rsquo; post&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Anyhow, check out my feed reader and be sure to vote!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=449920" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/u6Ku3f8k9m31KJo6zFH40agR-CU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u6Ku3f8k9m31KJo6zFH40agR-CU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/u6Ku3f8k9m31KJo6zFH40agR-CU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/u6Ku3f8k9m31KJo6zFH40agR-CU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=erWmnP5A"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=5Ag40lzJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=5Ag40lzJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/HD52YSC-t4s" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/22/mix-10k-challenge-entry.aspx</feedburner:origLink></item><item><title>Silverlight Dependency Properties</title><link>http://feedproxy.google.com/~r/BryantLikesBlog/~3/CaGptD8B7Rk/silverlight-dependency-properties.aspx</link><pubDate>Mon, 15 Dec 2008 18:08:00 GMT</pubDate><guid isPermaLink="false">b1dba0ec-7f0a-44f8-b88f-2f1cac820aaf:449641</guid><dc:creator>bryantlikes</dc:creator><slash:comments>10</slash:comments><wfw:commentRss>http://blogs.sqlxml.org/bryantlikes/rsscomments.aspx?PostID=449641</wfw:commentRss><comments>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/15/silverlight-dependency-properties.aspx#comments</comments><description>&lt;p&gt;I&amp;rsquo;ve seen this question a number of times in the &lt;a href="http://silverlight.net/forums"&gt;Silverlight Forums&lt;/a&gt;, so instead of just answering it one more time I decided to answer it here so I can refer back to this. The question generally looks like this:&lt;/p&gt;
&lt;p&gt;I have create a dependency property and the setter isn&amp;rsquo;t getting called during data binding. My dependency property is declared as follows:&lt;/p&gt;
&lt;div style="font-size:12pt;background:#181818;color:#e0e0e0;font-family:consolas;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;class&lt;/span&gt; &lt;span style="color:#c7c7f1;"&gt;MyClass&lt;/span&gt; : &lt;span style="color:#c7c7f1;"&gt;Control&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;int&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;MyProperty&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;get&lt;/span&gt; { &lt;span style="color:#8080c0;"&gt;return&lt;/span&gt; (&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt;)&lt;span style="color:#fef1a9;"&gt;GetValue&lt;/span&gt;(&lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;set&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#fef1a9;"&gt;SetValue&lt;/span&gt;(&lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt;, &lt;span style="color:#8080c0;"&gt;value&lt;/span&gt;); &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#c080c0;"&gt;// some custom code here&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#c080c0;"&gt;// Using a DependencyProperty as the backing store for MyProperty.&amp;nbsp; This enables animation, styling, binding, etc...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;static&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;readonly&lt;/span&gt; &lt;span style="color:#c7c7f1;"&gt;DependencyProperty&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt; =&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#c7c7f1;"&gt;DependencyProperty&lt;/span&gt;.&lt;span style="color:#fef1a9;"&gt;Register&lt;/span&gt;(&lt;span style="color:#60ff60;"&gt;&amp;quot;MyProperty&amp;quot;&lt;/span&gt;, &lt;span style="color:#8080c0;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt;), &lt;span style="color:#8080c0;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#c7c7f1;"&gt;MyClass&lt;/span&gt;), &lt;span style="color:#8080c0;"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1;"&gt;PropertyMetadata&lt;/span&gt;(0));&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason why the setter isn&amp;rsquo;t called here (at least the way I understand this), is that when data binding sets this value it isn&amp;rsquo;t calling the public property. Instead it is using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms597473(VS.95).aspx"&gt;SetValue&lt;/a&gt; on the dependency object instead. So the custom code is never called. What you need to do is add a PropertyChangedCallback to the DependencyProperty registration as follows:&lt;/p&gt;
&lt;div style="font-size:12pt;background:#181818;color:#e0e0e0;font-family:consolas;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;int&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;MyProperty&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;get&lt;/span&gt; { &lt;span style="color:#8080c0;"&gt;return&lt;/span&gt; (&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt;)&lt;span style="color:#fef1a9;"&gt;GetValue&lt;/span&gt;(&lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt;); }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#8080c0;"&gt;set&lt;/span&gt; &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#fef1a9;"&gt;SetValue&lt;/span&gt;(&lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt;, &lt;span style="color:#8080c0;"&gt;value&lt;/span&gt;); &lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#c080c0;"&gt;// Using a DependencyProperty as the backing store for MyProperty.&amp;nbsp; This enables animation, styling, binding, etc...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;public&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;static&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;readonly&lt;/span&gt; &lt;span style="color:#c7c7f1;"&gt;DependencyProperty&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;MyPropertyProperty&lt;/span&gt; =&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#c7c7f1;"&gt;DependencyProperty&lt;/span&gt;.&lt;span style="color:#fef1a9;"&gt;Register&lt;/span&gt;(&lt;span style="color:#60ff60;"&gt;&amp;quot;MyProperty&amp;quot;&lt;/span&gt;, &lt;span style="color:#8080c0;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt;), &lt;span style="color:#8080c0;"&gt;typeof&lt;/span&gt;(&lt;span style="color:#c7c7f1;"&gt;MyClass&lt;/span&gt;), &lt;span style="color:#8080c0;"&gt;new&lt;/span&gt; &lt;span style="color:#c7c7f1;"&gt;PropertyMetadata&lt;/span&gt;(0, &lt;span style="color:#fef1a9;"&gt;MyPropertyChanged&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;private&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;static&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;void&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;MyPropertyChanged&lt;/span&gt;(&lt;span style="color:#c7c7f1;"&gt;DependencyObject&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;o&lt;/span&gt;, &lt;span style="color:#c7c7f1;"&gt;DependencyPropertyChangedEventArgs&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;e&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((&lt;span style="color:#c7c7f1;"&gt;MyClass&lt;/span&gt;)&lt;span style="color:#fef1a9;"&gt;o&lt;/span&gt;).&lt;span style="color:#fef1a9;"&gt;OnMyPropertyChanged&lt;/span&gt;((&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt;)&lt;span style="color:#fef1a9;"&gt;e&lt;/span&gt;.&lt;span style="color:#fef1a9;"&gt;NewValue&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#8080c0;"&gt;private&lt;/span&gt; &lt;span style="color:#8080c0;"&gt;void&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;OnMyPropertyChanged&lt;/span&gt;(&lt;span style="color:#8080c0;"&gt;int&lt;/span&gt; &lt;span style="color:#fef1a9;"&gt;newValue&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#c080c0;"&gt;// custom code goes here instead&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now whenever the property changes the OnMyPropertyChanged method will get called. Notice that this is where you put your custom code to handle the property changing. This code will get called when the public property setter is called or when the property is changed using the SetValue method. &lt;/p&gt;
&lt;p&gt;More information on Dependency Properties can be found &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty(VS.95).aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.sqlxml.org/aggbug.aspx?PostID=449641" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Naafd36eDx1zkOj71G8-Oa_Sm-c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Naafd36eDx1zkOj71G8-Oa_Sm-c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Naafd36eDx1zkOj71G8-Oa_Sm-c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Naafd36eDx1zkOj71G8-Oa_Sm-c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=Ndng4OWA"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/BryantLikesBlog?a=FoKI3GEr"&gt;&lt;img src="http://feeds.feedburner.com/~f/BryantLikesBlog?i=FoKI3GEr" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BryantLikesBlog/~4/CaGptD8B7Rk" height="1" width="1"/&gt;</description><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/WPF_2F00_E/default.aspx">WPF/E</category><category domain="http://blogs.sqlxml.org/bryantlikes/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.sqlxml.org/bryantlikes/archive/2008/12/15/silverlight-dependency-properties.aspx</feedburner:origLink></item></channel></rss>
