<?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>Richard Griffin's Blog</title><link>http://blogs.conchango.com/richardgriffin/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/conchango/RichardGriffin" type="application/rss+xml" /><feedburner:emailServiceId>conchango/RichardGriffin</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>Silverlight 3.0 - 3D Flip Action using Plane Projection</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/16bMYEAp57g/silverlight-3-0-3d-flip-action-using-plane-projection.aspx</link><pubDate>Thu, 16 Apr 2009 16:58:43 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:14961</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/14961.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=14961</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=14961</wfw:comment><description>&lt;p&gt;After reading &lt;a href="http://jobijoy.blogspot.com/" target="_blank"&gt;Jobi Joy’s&lt;/a&gt; post about a &lt;a href="http://jobijoy.blogspot.com/2009/04/3d-flipper-control-using-silverlight-30.html" target="_blank"&gt;3D Flip Control&lt;/a&gt; he had built. It gave me an idea about creating a Silverlight 3D Flip Action that can be applied to any UIElement. It also meant that I got to play with the new Plane &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/20090416_1719_6AD9B903.png"&gt;&lt;img style="border-right-width:0px;margin:5px 5px 5px 10px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="2009-04-16_1719" border="0" alt="2009-04-16_1719" align="right" src="http://blogs.conchango.com/blogs/richardgriffin/20090416_1719_thumb_6C7A5F0A.png" width="319" height="484" /&gt;&lt;/a&gt;Projection bits in SL 3.0. To do this sort of interaction in WPF I use a series of data templates that using template binding for the back and front controls, pretty much a standard mechanism that you see around. &lt;a target="_blank"&gt;Fluid Kit&lt;/a&gt; also has a flip implementation which I suggest you take a look at if you have not already. Fluid Kit rocks BTW. The same code below is based on Jobi Joy’s 3D control just refactored into an Action.&lt;/p&gt;  &lt;p&gt;The 3D Flip Action can be triggered using a standard Event Trigger such as MouseLeftButtonDown or an Event Trigger of your choice. There are some animation properties for you to supply; a point value for the Projection Y axis, (where you would like to move from, and where you would like to move to); and a duration period for the from and to Storyboard’s used to animate the front and back UIElements on the Y axis. There are also a couple of Flip properties, the Action needs to know about its container, the front and back Elements and also if the front control is visible on startup. The container is required so that we have a UIElement to apply the Plane Projection. &lt;/p&gt;  &lt;p&gt;Using the 3D Flip Action is easy, simply create a Layout element like a Grid and then drop in your UIElements for the front and back, in my example I have used images. Once you have this Xaml created then select the Flip Action from the Behaviors tab and drop this onto the Layout element. As outlined earlier you can then tweak the animation and flip properties to provide the interaction that you want.&lt;/p&gt;  &lt;p&gt;At the moment the Flip Action only works on the Y axis, but with some simple refactoring it should be straight forwards to support both the X and Z axis.&lt;/p&gt; &lt;iframe style="border-bottom:#dde5e9 1px solid;border-left:#dde5e9 1px solid;padding-bottom:0px;background-color:#ffffff;margin:3px;padding-left:0px;width:280px;padding-right:0px;height:66px;border-top:#dde5e9 1px solid;border-right:#dde5e9 1px solid;padding-top:0px;" src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/Silverlight3/SilverlightApplicationBehavioursV2.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=14961" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=16bMYEAp57g:V8fmGhcx02I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=16bMYEAp57g:V8fmGhcx02I:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=16bMYEAp57g:V8fmGhcx02I:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=16bMYEAp57g:V8fmGhcx02I:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=16bMYEAp57g:V8fmGhcx02I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2009/04/16/silverlight-3-0-3d-flip-action-using-plane-projection.aspx</feedburner:origLink></item><item><title>Behaviors, Actions and View Models in Silverlight</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/lwiMsP3XbZI/behaviors-in-silverlight-a-first-look.aspx</link><pubDate>Mon, 30 Mar 2009 10:38:06 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:14768</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/14768.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=14768</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=14768</wfw:comment><description>&lt;p&gt;Behaviors are new to Silverlight 3 and WPF.&lt;/p&gt;  &lt;p&gt;The main reason we now have Behaviors in Silverlight was due to the lack of support in Silverlight of triggers. Triggers in WPF are incredibly useful as they provide the ability to change the look and feel&amp;#160; of UI Elements dynamically based on the state of the application directly in the Xaml. In fact they are so useful we have 2 types Data Triggers and UI Triggers. Data Triggers can be used to respond to changes in the data that the UI Elements are bound to. UI Triggers can be used to respond to UI level events.&lt;/p&gt;  &lt;p&gt;My current view of Behaviors is that of Triggers on steroids, in that they are an evolution from what we know in WPF and matured into a more componentised mechanism allowing designers the ability to drag and drop behaviors onto elements with out the need to create them manually. There are some standard behaviors that have been posted around on various blogs which i strongly suggest taking a look &lt;a href="http://gallery.expression.microsoft.com/MIXBehaviorPack" target="_blank"&gt;at&lt;/a&gt; and check out &lt;a href="http://blois.us/blog/" target="_blank"&gt;Pete Blois’s&lt;/a&gt; &lt;a href="http://videos.visitmix.com/MIX09/C27M" target="_blank"&gt;session&lt;/a&gt; at &lt;a href="http://videos.visitmix.com/MIX09/C27M" target="_blank"&gt;Mix09&lt;/a&gt;. Now, designers will still need to chat to a developer in order to create custom behaviors, however this is worth the investment as there is an opportunity to create a &lt;a href="http://sltoolkit.codeplex.com/" target="_blank"&gt;behaviors control library&lt;/a&gt; that can be used by your applications. Not only can we easily provide consistent experiences within our Silverlight applications but also in WPF and Surface applications, libraries will need to be recompiled to work with the specified deployment targets.&lt;/p&gt;  &lt;p&gt;So what are behaviors and how can they be used to help out when building applications ??&lt;/p&gt;  &lt;p&gt;Behaviors in general are best thought of in a metaphorical view, lets clear this up with an example. When going to a friends party we generally behave differently in comparison to when we go to dinner party at our CEO’s house. When we drive a car our behavior is to fasten the seat belt. Therefore, behaviors can be thought of as something that is intrinsic to us in that its in our nature to behave in a certain way under particular environments, when our environment changes this will also have an affect on our behavior. If we take this analogy and apply it to a UI Element in our application it makes thinking about what should be classified as a behavior. For example, if we want a UI Element that can be dragged around the screen we would provide the UI Element with the drag behavior, if we want to provide deep zoom capabilities to our application we would provide the Multi Scale Image with the deep zoom behavior. &lt;/p&gt;  &lt;p&gt;What is slightly confusing at first is that we have 2 types of behaviors, behaviors and actions. When sub classing a behavior its my current belief that we are suggesting that this behavior is a UI behavior and an Action is performed in response to a state change. To prove this statement I have a couple of simple implementations that I wrote to test out this theory. At this stage you will need to download the code in order to follow the descriptions below.&lt;/p&gt;  &lt;p&gt;&lt;iframe style="border-right:#dde5e9 1px solid;padding-right:0px;border-top:#dde5e9 1px solid;padding-left:0px;padding-bottom:0px;margin:3px;border-left:#dde5e9 1px solid;width:242px;padding-top:0px;border-bottom:#dde5e9 1px solid;height:63px;background-color:#ffffff;" src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/Silverlight3/SilverlightApplicationBehaviours.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;h3&gt;Creating the behavior&lt;/h3&gt;  &lt;p&gt;First I started with the approach we have been using for a while, create your animation in Xaml using Blend then write some code behind to trigger the animation, if we were in WPF then we could use a Trigger in Xaml to do this but for the examples below I am targeting Silverlight. Fairly straight forwards apart from the fact we had to write some code behind, which is not great for the designer. I created 2 animations, Fade In and a Fade Out animation that can be applied to any Framework element. Now that we have these its time to create a behavior. The first task here is to ensure you have the right assembly referenced in your project Microsoft.Expression.Interactivity that provides the base classes that your behavior and actions will subclass. Once you have this in your project create a new class and derive it from Behavior&amp;lt;T&amp;gt;. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior0_286D6279.png"&gt;&lt;img title="Expression_Blend_Behavior0" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin:5px 10px 5px 5px;border-right-width:0px;" height="217" alt="Expression_Blend_Behavior0" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior0_thumb_3D2F352C.png" width="644" align="left" border="0" /&gt;&lt;/a&gt;In my example I am using Behavior&amp;lt;FrameworkElement&amp;gt; and due to this I have added a local field which is also of the same type so that there is a reference wired up to the UI Element that we are attaching the behavior too. The behavior requires values to be setup so that the element in order to tweak the behavior to match our requirements this is done using dependency properties. In order to expose the properties in Blend add the Category attribute to you properties. The final step is to override the OnAttached and OnDetached methods. In my example I only override the OnAttached method and it in here where the Storyboard animations to FadeIn and Out the Framework Element live. Nothing to difficult about that. Now that we have created the behavior we need to attach it to the Framework &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior1_2F10462F.png"&gt;&lt;img title="Expression_Blend_Behavior1" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin:5px 5px 5px 10px;border-right-width:0px;" height="172" alt="Expression_Blend_Behavior1" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior1_thumb_46C77D95.png" width="244" align="right" border="0" /&gt;&lt;/a&gt;Element we can do this in Blend very easily. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior_6C50FAF6.png"&gt;&lt;img title="Expression_Blend_Behavior" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin-left:0px;margin-right:0px;border-right-width:0px;" height="191" alt="Expression_Blend_Behavior" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Behavior_thumb_76A21F56.png" width="244" align="left" border="0" /&gt;&lt;/a&gt;Open up the project in Blend and open up the asset library and there is a new tab called behaviors where there is a listing of available Behaviors and Action can be used in the project. To apply the FadeBehavior in our case to the image element, select the correct behavior and drag this onto the image element, this will wire up the behavior to the image. To change the granularity of the behavior Blend provides a UI in order to change the values which we provided.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;Creating the action&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action_3C46A975.png"&gt;&lt;img title="Expression_Blend_Action" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin:5px 10px 5px 5px;border-right-width:0px;" height="244" alt="Expression_Blend_Action" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action_thumb_1433FA56.png" width="205" align="left" border="0" /&gt;&lt;/a&gt; In essence the process for building the action is identical to creating a behavior. The only change required is an obvious one which is the base class needs changing to TargetedTriggerAction&amp;lt;T&amp;gt;. Sweet… There are also a couple of other subtle changes. In the behavior I used a local variable to hold an instance of the element which the behavior was being applied to, this was done using a rather helpful method in the base class called AssociatedObject. The method is not provide by this particular Trigger class, an additional Dependency Property has been added in order for the action to know what it has been applied to. The other change is that although there are OnDetached and OnAttached method overrides in this example I chose to override the Invoke method. &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action2_12832E82.png"&gt;&lt;img title="Expression_Blend_Action2" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin:5px 5px 5px 10px;border-right-width:0px;" height="210" alt="Expression_Blend_Action2" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action2_thumb_6ADCB257.png" width="244" align="right" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;To apply the action follow the same steps but select the required action this time round and associate the action with a button. Here we want to trigger the Fade Action in response to a users interaction, in this case clicking on a button. Here is where the metaphoric use of behaviors and actions differ, the fading of the image in this case is required when a user interacts with a UI Element on screen, in the behavior scenario we wanted the fading to be intrinsic to the control.&lt;/p&gt;  &lt;h3&gt;&amp;#160;&lt;/h3&gt;  &lt;h3&gt;Creating a View Model action&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action3_3E538271.png"&gt;&lt;img title="Expression_Blend_Action3" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;margin:5px 10px 5px 5px;border-right-width:0px;" height="230" alt="Expression_Blend_Action3" src="http://blogs.conchango.com/blogs/richardgriffin/Expression_Blend_Action3_thumb_04643F85.png" width="244" align="left" border="0" /&gt;&lt;/a&gt; In the previous examples the we used the behavior pattern specifically in the Xaml. I wanted to try out what the code would look like when data binding a custom action to a property on the View Model. The idea came from previous projects where I would require a loading animation to fire up while the View Model went and got the required data from the data service. Once the data has started to come back the animation would fade out and the control displayed with data ready for the user. These animations were controlled using a Dependency Property declared in the User Control and then data bound to a property on the View Model, each View Model implements INotifyPropertyChanged. This seems like a prime candidate for a reusable action that the developer can write once and then allow the designer to apply in Blend. This method reminds me of those collections of extension methods or type converters that we build during the implementation of a UI, I am sure that the same approach can be used with behaviors. For this example I created a Visibility behavior which was then data bound to a property on the View Model called CurrentVisibility. Unfortunately this is where I found a couple of problems, I wanted to data bind the behaviors in the Xaml.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;Image x:Name=&amp;quot;image_Copy1&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Source=&amp;quot;01.jpg&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Stretch=&amp;quot;Uniform&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Height=&amp;quot;Auto&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Width=&amp;quot;Auto&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; d:LayoutOverrides=&amp;quot;Width, Height&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Grid.Column=&amp;quot;2&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;i:Interaction.Triggers&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;i:EventTrigger EventName=&amp;quot;Loaded&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&amp;lt;SilverlightApp_Behaviours:VisibilityBehavior CurrentVisibilityBehavior=&amp;quot;{Binding Path=CurrentVisibility}&amp;quot; /&amp;gt;        &lt;br /&gt;&lt;/strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/i:EventTrigger&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/i:Interaction.Triggers&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Image&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This was giving me runtime errors so i tried to do the data binding from the code behind like so.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;this.AssociatedObject.SetBinding(UIElement.VisibilityProperty, new Binding(&amp;quot;CurrentVisibility&amp;quot;) { Mode = BindingMode.TwoWay });&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But this did not seem to work out either. In the end i wired the behavior to the View Model’s property changed event handler and sniffed out the CurrentVisibility property, which is not all too nice. The data context of the behavior is right so there must be a reason for the binding not to work which I am yet to discover. However, the ability for the developer to create behaviors that can extend the View Model in such away that the designer now has the ability to apply these using Blend is a very powerful mechanism. &lt;/p&gt;  &lt;p&gt;Behaviors are a powerful addition to Silverlight. What I have found to be most poignant is that I no longer have a reliance on Commands and the command binding pattern that I have been using in WPF and Silverlight. In the previous sample I would have used Commands to force separation between View and View Model in order for me to write code in the View Model which responded to a user interaction that would have required doing some processing on a data set. Now with behaviors data binding can be used. Personally I like Commands and they have served me extremely well in the past, however I do like the behavior metaphor as this makes the problem easier to visualise when talking about behaviors of the visual elements rather than using the Command terminology.&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=14768" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=lwiMsP3XbZI:SloEYsjkVKY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=lwiMsP3XbZI:SloEYsjkVKY:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=lwiMsP3XbZI:SloEYsjkVKY:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=lwiMsP3XbZI:SloEYsjkVKY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=lwiMsP3XbZI:SloEYsjkVKY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2009/03/30/behaviors-in-silverlight-a-first-look.aspx</feedburner:origLink></item><item><title>Designer Developer Workflow – The art of collaboration using Xaml PART III</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/dQXOAvJpdAM/designer-developer-workflow-the-art-of-collaboration-using-xaml-part-iii.aspx</link><pubDate>Mon, 26 Jan 2009 20:16:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:14076</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/14076.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=14076</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=14076</wfw:comment><description>&lt;p&gt;Last week Microsoft published the January issue of the Expression Newsletter. If you have not seen the newsletter its a great series of articles focused on using Silverlight and the Expression tools to create amazing rich interactive solutions. In this latest issue I talk about carving up the User Interface from the different prospectives of the individual roles involved in the workflow and also introduce the role of the Integrator. If you are designing and developing with Xaml sign up to the newsletter at &lt;a href="http://www.microsoft.com/expression/news-press/newsletter/"&gt;http://www.microsoft.com/expression/news-press/newsletter/&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Part I – &lt;a href="http://expression.microsoft.com/en-us/cc941385.aspx" target="_blank"&gt;Passive View, View Models and Silverlight Architectural best practices&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Part II – &lt;a href="http://expression.microsoft.com/en-us/dd279541.aspx" target="_blank"&gt;A designers prospective on using Expression Blend&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Part III – &lt;a href="http://expression.microsoft.com/en-us/dd434644.aspx" target="_blank"&gt;Carving up the UI&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/felixcorke" target="_blank"&gt;Felix&lt;/a&gt; and I have also setup a project on &lt;a href="http://www.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt; called &lt;a href="http://www.codeplex.com/deliciousSilverlight" target="_blank"&gt;Del.icio.us Silverlight&lt;/a&gt; where you can download the source code and hopefully join us on our journey building an innovative browser for &lt;a href="http://delicious.com/" target="_blank"&gt;Del.icio.us&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=14076" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=dQXOAvJpdAM:fbaehYs7qKE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=dQXOAvJpdAM:fbaehYs7qKE:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=dQXOAvJpdAM:fbaehYs7qKE:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=dQXOAvJpdAM:fbaehYs7qKE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=dQXOAvJpdAM:fbaehYs7qKE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2009/01/26/designer-developer-workflow-the-art-of-collaboration-using-xaml-part-iii.aspx</feedburner:origLink></item><item><title>Silverlight themes 101 - Resource Dictionary Visual Studio Item Template</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/WKqzkGJwWdE/silverlight-themes-101-resource-dictionary-visual-studio-item-template.aspx</link><pubDate>Wed, 05 Nov 2008 11:24:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:13112</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/13112.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=13112</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=13112</wfw:comment><description>&lt;p&gt;Thought that i would share this simple item template that I created for Silverlight. In a previous post about Silverlight themes I was getting a little frustrated that there is no Item template in VS for Silverlight Resource Dictionaries. So I created my own.&lt;/p&gt;  &lt;p&gt;Download the zip file and stash it in your \Visual Studio 2008\Templates\ItemTemplates directory. Unfortunately you still have to change the build properties on the Resource Dictionary from Page to Content or Resource depending on your intentions; Content for Xaml; and Resource for codebehind. If you know how to change this so that the Build properties can be set automatically, then please let me know. You can pick up the item template from my skydrive.&lt;/p&gt; &lt;iframe src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/SIlverlight%20Resource%20Dictionary" style="margin:3px;padding:0px;width:260px;height:66px;" mce_src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/SIlverlight%20Resource%20Dictionary" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=13112" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=WKqzkGJwWdE:RK7AozViR78:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=WKqzkGJwWdE:RK7AozViR78:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=WKqzkGJwWdE:RK7AozViR78:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=WKqzkGJwWdE:RK7AozViR78:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=WKqzkGJwWdE:RK7AozViR78:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/11/05/silverlight-themes-101-resource-dictionary-visual-studio-item-template.aspx</feedburner:origLink></item><item><title>Silverlight Themes 101</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/pMfgttMRq6k/silverlight-themes-101.aspx</link><pubDate>Tue, 04 Nov 2008 14:41:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:13103</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/13103.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=13103</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=13103</wfw:comment><description>&lt;p&gt;With the recent public release of the Silverlight Toolkit one of the interesting features has to be the Theming. There has been a number of cool posts about theming and &lt;a href="http://jonas.follesoe.no/" target="_blank"&gt;Jonas&lt;/a&gt; has a great post about how to leverage existing &lt;a href="http://jonas.follesoe.no/ChangeTheLookOfYourSilverlightApplicationUsingThemes.aspx" target="_blank"&gt;themes&lt;/a&gt; that have already be designed.&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_59311C95.png" title="image" style="border-width:0px;margin:10px 5px 10px 10px;display:inline;" alt="image" width="391" align="right" border="0" height="153"&gt;&lt;/p&gt;  &lt;p&gt;Theming in WPF is a great feature and something that was rather disappointingly not part or the Beta 2 Release, Nikhil came up with a good work around, however it was still rather developer focused in its implementation and not too designer friendly. My current project requires the ability for the controls to be themed for different implementations on startup and also the ability of a generic skin to be applied if certain parameters have been supplied. The new Themes provides all the functionality that I required to achieve the expectations of the client. However, it was not as simple as I had hoped. Once you know about a couple of little quirks then it all falls into place, so I thought that I would put together a simple project that highlights the gotchas and includes the 3 different ways of leveraging theming in your Silverlight application.&lt;/p&gt;  &lt;p&gt;Before we dive in a little bit of background information on the project. The sample application is a Social Bookmarking control that has become common place &lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_4A1A3DBB.png" title="image" style="border-width:0px;margin:10px 10px 10px 5px;display:inline;" alt="image" width="525" align="left" border="0" height="91"&gt;on web pages and blogs. My goal is to have a large social bookmarking theme and a small social bookmarking theme that can be applied to the control.&amp;nbsp;&amp;nbsp; The requirement has come from the designer who has already built the 2 styles and templates for the social bookmarking control and needs them wired up.&amp;nbsp; The Social bookmark control is a lookless control, in that it derives from Control and has declared TemplateParts for the UI elements that it needs in its tree. It also lives in its own project called Controls. The MyThemes project uses the Social bookmarker control and is where the themes will be declared. The final project is a web project to host the MyThemes Xap.&lt;/p&gt;  &lt;p&gt;The first task is to remove all the x:Key properties from the App.xaml file, but only for the control that uses the style, the other styles that are referenced by the control templates in the App.xaml can stay as they are.&lt;/p&gt;  &lt;p&gt;The next task is to create a new folder in the MyThemes project and to hold our custom themes, in this case I created 2 Silverlight User Controls called Large and Small. Remove the code behind for the User Controls as we won’t &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/image_25F4E32C.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_thumb_29FF30FE.png" title="image" style="border-width:0px;margin:10px 5px 10px 10px;display:inline;" alt="image" width="1061" align="right" border="0" height="334"&gt;&lt;/a&gt;be needing them. Open up the Xaml and remove all the code, as we need to use ResourceDictionary for our themes. The final part here is to change&amp;nbsp; the properties on the Large and Small Xaml files to be of type Content. It would be great to see a Silverlight Resource Dictionary template in VS which would do these manual steps. The file properties caused me the most trouble in this whole process which I will pick up later on in the post.&lt;/p&gt;  &lt;p&gt;Move over to the App.Xaml and locate the style for the large social bookmarker control and cut and paste this into the large theme Xaml file we created in the previous step, do the same for the small. You will almost certainly have to fix references to assemblies so go and track them down and fix them up.&lt;/p&gt;  &lt;p&gt;Taking a quick look back we have created our new themes for the application and reused the styles that were in our original App.xaml file that the designer built. Our next step is to wire up the Social bookmarker control to the themes. Now this is important, as we have set the properties on our theme files to be Content we have to load the themes up using Xaml in a declarative manner. So head over to MyTheme project and add a reference to the Theming assembly then open up Page.xaml so that we can wire up the control to the right theme. The Implicit Style Manager provides all the goo that we need for associating the control to the theme and we do this by calling the Resource Dictionary Uri and the ApplyMode dependency properties. &lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_1ED5A6B4.png" title="image" style="border-width:0px;margin:10px 10px 10px 5px;display:inline;" alt="image" width="262" align="left" border="0" height="56"&gt; &lt;/p&gt;  &lt;p&gt;In my sample you can see that I am applying the Small theme to the control. Ok so we are done not too tricky hit F5 and make sure that you can see the control. My own experiences here is that the error messages that you get back are not particularly helpful, most of the time it will say that the Xaml line where you declared your Implicit Style Manager is broken, what it actually means to say is that you have a problem with the Xaml declared within the file you are referencing. Now this could be the case but it also could be that you have not changed the file to have the correct build properties. What I found out here is that if you are going down the declarative Xaml approach the file properties need to be set too Content, if you are going to load up the themes from code then you need to change the build&amp;nbsp; pr&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/image_37D176F9.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_thumb_69C91783.png" title="image" style="border-width:0px;margin:10px 10px 10px 5px;display:inline;" alt="image" width="1137" align="left" border="0" height="432"&gt;&lt;/a&gt;operties of the file to a resource.&lt;/p&gt;  &lt;p&gt;So let go ahead and add a button so that we hit the button and load up the Social bookmarker control with the large theme. In order to do this we need to write some code in the Page.xaml.cs file and more importantly we have to change the build properties on the LargeTheme Resource dictionary as we plan on applying the theme using code. So first go and change the build properties on the LargeTheme.xaml file to be Resources. Now jump back to the code behind for the Page.xaml.cs and here we need to wire up the theme to the Social bookmarker control. There are a couple of steps that we need to do here; Remove the control from the visual tree; new up another Social bookmarker and add this back into the tree; finally we need to tell the Implicit Style Manager which&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/image_30B23A81.png" title="image" style="border-width:0px;margin:10px 5px 10px 10px;display:inline;" alt="image" width="400" align="right" border="0" height="86"&gt; theme we want and then apply the theme to the Social bookmarker control. &lt;/p&gt;  &lt;p&gt;Hit F5 and you will now be able to view the Control with the Small theme applied and then hit the button and the Social bookmarker control will change the theme and load up with the large theme applied. Cool.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;The final part of the puzzle is to create a new Silverlight Class library to hold a compiled version of the themes, this is another option for how to use theming. Once you have created the project remove all the generated .cs files and copy over the Large theme from the previous project. Double check to make sure that the file still has the resource build properties selected and then build the project. We can now jump back to the Page.xaml.cs file and change the URI to point to our new baked in theme. Sweet hit F5.&lt;/p&gt;  &lt;p&gt;So there are 3 different ways in which to use the new theming in your Silverlight application depending on what your needs are and how far you want to go with decoupling your themes from you main Silverlight application and controls library.&amp;nbsp; You can grab the source from my skydrive.&lt;/p&gt; &lt;iframe src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/Silverlight%20Themes" style="margin:3px;padding:0px;width:240px;height:66px;" mce_src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrowdetail.aspx/Silverlight%20Themes" scrolling="no" frameborder="0"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=13103" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=pMfgttMRq6k:BOpyTTD4CfU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=pMfgttMRq6k:BOpyTTD4CfU:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=pMfgttMRq6k:BOpyTTD4CfU:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=pMfgttMRq6k:BOpyTTD4CfU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=pMfgttMRq6k:BOpyTTD4CfU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/11/04/silverlight-themes-101.aspx</feedburner:origLink></item><item><title>tech-ed Barcelona 2008 Presentation overview</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/iYcwCiYBGwQ/tech-ed-barcelona-2008-presentation-overview.aspx</link><pubDate>Mon, 03 Nov 2008 17:41:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:13083</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/13083.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=13083</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=13083</wfw:comment><description>&lt;p&gt;So the count down begins for the kick off to &lt;a href="http://www.microsoft.com/emea/teched2008/developer/" target="_blank"&gt;tech-ed Barcelona&lt;/a&gt; 2008 and my third time at the event presenting so really excited about next week. Tech-ed is always one of the better organised events that I go to and the country drinks are always fun to meet new geeks. This year I am co-presenting with my partners in crime &lt;a href="http://blogs.conchango.com/felixcorke" target="_blank"&gt;Felix Corke&lt;/a&gt; and &lt;a href="http://www.interact-sw.co.uk/iangblog/" target="_blank"&gt;Ian “WPF Jedi” Griffiths&lt;/a&gt;. After the great feedback Felix and I have had with the Mix Essentials speaker tour we did this year we have decided to refactor our “Beauty and the Geeks” talk so that rather than talk about the way in which we work we are going to show you live on stage by building a sample application. I will also be hanging out on the Silverlight and Live Services ATE stand during the week if you want to ask questions then this is a great place to whiteboard some problems.&lt;/p&gt;  &lt;p&gt;So if you are attending and you would like to know more about Developer-Designer Workflow when using Blend and Visual Studio please come and check out our session. If you want to hook up for a beer or three drop me an email. I will be twittering throughout the event so you can follow my updates at &lt;a href="http://twitter.com/RichGee" title="http://twitter.com/RichGee"&gt;http://twitter.com/RichGee&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;WUX310&lt;/b&gt;     &lt;br&gt;&lt;b&gt;Beauty and the Geeks: Developer-Designer Workflow&lt;/b&gt;     &lt;br&gt;November 13 13:30 - 14:45     &lt;br&gt;Room 114 &lt;/p&gt;  &lt;p&gt;&lt;i&gt;Developer - designer workflow is one of the hottest topics talked and blogged about this year in the RIA space. If you are building or thinking about building RIA applications using Silverlight then this session is for you. Come and interact with a real life team that consists of a Designer, Integrator and Developer as they implement a Silverlight solution live on stage leveraging tools such as Adobe Photoshop and Illustrator, Expression Blend and Visual Studio using a workflow that allows them to build applications effectively in an agile environment. The session aims to provide a deeper insight into the building of RIA applications using not only Microsoft technologies but also the tools that designers have been using for the last 10 years&lt;/i&gt;&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=13083" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=iYcwCiYBGwQ:7sPZjG7nIyc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=iYcwCiYBGwQ:7sPZjG7nIyc:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=iYcwCiYBGwQ:7sPZjG7nIyc:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=iYcwCiYBGwQ:7sPZjG7nIyc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=iYcwCiYBGwQ:7sPZjG7nIyc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/11/03/tech-ed-barcelona-2008-presentation-overview.aspx</feedburner:origLink></item><item><title>Del.icio.us Silverlight Library, Tag Clouds and Dependency Injection</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/PIa7R6LOYe0/del-icio-us-silverlight-library-tag-clouds-and-dependency-injection.aspx</link><pubDate>Thu, 07 Aug 2008 16:00:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:12168</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/12168.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=12168</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=12168</wfw:comment><description>&lt;p&gt;Last year I built a couple of WPF tag cloud applications that hooked up to my &lt;a href="http://del.icio.us/" target="_blank"&gt;del.icio.us&lt;/a&gt; account and displayed the data using different visualisations which&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Del.icio.usSilverlightTagCloud_CEEE/tagcloud_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Del.icio.usSilverlightTagCloud_CEEE/tagcloud_thumb.png" style="border-width:0px;margin:10px 5px 10px 10px;" alt="tagcloud" align="right" border="0" height="400" width="644"&gt;&lt;/a&gt; included a tag cloud in a variety of different flavours and I also used the Time Line Panel from the &lt;a href="http://www.blendables.com/" target="_blank"&gt;blendables&lt;/a&gt; control suite from &lt;a href="http://www.identitymine.com/" target="_blank"&gt;Identity Mine.&lt;/a&gt; To access del.icio.us I used a .net library up on &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=174552" target="_blank"&gt;Source Forge&lt;/a&gt; originally developed for use in the del.icio.us Winforms client called &lt;a href="http://netlicious.sourceforge.net/" target="_blank"&gt;Netlicious&lt;/a&gt; which was originally written for .net 2.0 by Nate Zobrist. After playing with &lt;a href="http://wordle.net/" target="_blank"&gt;Wordle&lt;/a&gt; I revisited the WPF applications and start to wonder how I build a similar application in Silverlight.&lt;/p&gt;  &lt;p&gt;The first challenge was to rebuild the del.icio.us library to provide a mechanism that would allow the Silverlight client to retrieve content from my account. It would be cool to see a LINQ to del.icio.us library at some point. After looking through the existing library I decided that to rewrite the library and take advantage of the 3.5 goodness which has been added since the 2.0 release. I also wanted to change the architecture slightly so that the library used Interfaces and roll in &lt;a href="http://ninject.org/" target="_blank"&gt;Ninject&lt;/a&gt; at the same time. Ninject is a very cool DI library from &lt;a href="http://kohari.org/" target="_blank"&gt;Nate Kohari&lt;/a&gt; which does exactly what it says on the tin with not a sniff of Xml configuration insight. Using the Netlicious as a reference point I rebuilt the library rather quickly, there are still some modifications to make, more unit tests to write and also the mocks to finish off but all the pieces are in place ready to be completed.&lt;/p&gt;  &lt;p&gt;With the library now in place I started to build the Silverlight Client, when you use Ninject or unity in your Silverlight application you will start to create a Presenter View style pattern that takes advantage of a service locator class in your client and the results are all very impressive, &lt;a href="http://jonas.follesoe.no/" target="_blank"&gt;Jonas&lt;/a&gt; has a great example and talks more about using Silverlight and Ninject &lt;a href="http://jonas.follesoe.no/YouCardRevisitedImplementingDependencyInjectionInSilverlight.aspx" target="_blank"&gt;here&lt;/a&gt;. The main advantage of this approach is the pure separation of concerns from the Xaml Views, all the work is done in the View Model classes which can be isolated and tested easily using the Silverlight Testing templates. Jeff Wilcox is the chap with his finger on the pulse so if your interested or want the latest &lt;a href="http://www.jeff.wilcox.name/2008/06/06/unit-testing-templates-for-microsoft-silverlight-2-beta-2/" target="_blank"&gt;templates&lt;/a&gt; head over to his &lt;a href="http://www.jeff.wilcox.name/" target="_blank"&gt;blog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;After creating the views, view models and required bits for Ninject to work, I rolled in &lt;a href="http://blogs.msdn.com/devdave/default.aspx" target="_blank"&gt;Dev Dave's&lt;/a&gt; &lt;a href="http://blogs.msdn.com/devdave/archive/2008/07/17/layout-transitions-an-animatable-wrappanel.aspx" target="_blank"&gt;Animated Wrap Panel&lt;/a&gt; to allow for a tag cloud look and feel to the application. In the original WPF applications I used a Converter to change the size of the font however this changed when I rolled in the Animated Wrap Panel, the converter is still part of the project just in case you want to try it out.&amp;nbsp; With the Animated Wrap Panel in all that was left to do was create the web site and a WCF service call to deal the cross domain calls and also to provide credentials so that we can access the account on del.icio.us. &lt;/p&gt;  &lt;p&gt;Future enhancements that I have in mind include; a richer client that takes advantage of Silverlight's persistence storage; adding the ability to search tags and posts; creating a Posts control so that the user can select a tag and view related posts; and also adding support for Bundles in the client. You can get the current drop of the del.icio.us Silverlight library and the current Silverlight application from my SkyDrive. If you are interested in helping out with building the del.icio.us client or you have some cool design ideas for the client please add a comment or drop me an email. &lt;/p&gt; &lt;iframe src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrow.aspx/SL2B2%20Demos" style="margin:3px;padding:0px;width:240px;height:26px;" mce_src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrow.aspx/SL2B2%20Demos" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=12168" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=PIa7R6LOYe0:-0neWe2yZd4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=PIa7R6LOYe0:-0neWe2yZd4:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=PIa7R6LOYe0:-0neWe2yZd4:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=PIa7R6LOYe0:-0neWe2yZd4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=PIa7R6LOYe0:-0neWe2yZd4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/08/07/del-icio-us-silverlight-library-tag-clouds-and-dependency-injection.aspx</feedburner:origLink></item><item><title>Wordle - text clouds</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/0eC6h2-FQaI/wordle-text-clouds.aspx</link><pubDate>Wed, 30 Jul 2008 08:35:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:12067</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/12067.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=12067</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=12067</wfw:comment><description>&lt;p&gt;If you have not been over to &lt;a href="http://wordle.net/" target="_blank"&gt;Wordle&lt;/a&gt; then it's definitely worth checking out. Personally I really like the tag cloud metaphor as the information that I am &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Wordle_1023A/wordle%20my%20blog_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Wordle_1023A/wordle%20my%20blog_thumb.png" style="border-width:0px;margin:10px 5px 10px 10px;" alt="wordle my blog" align="right" border="0" height="456" width="644"&gt;&lt;/a&gt;looking for seems to be more obvious than scrolling through a long list of information, it's especially handy when you want to quickly find some data without using search. Steve Poole creator of Wordle has built the application using Java and provides possibly the easiest way of creating text clouds I have found to date. You can either point Wordle at a blog or you can point it at a user on &lt;a href="http://del.icio.us/" target="_blank"&gt;del.icio.us&lt;/a&gt; once you have selected the end point that you want Wordle to data visualise your a click away from creating your first text cloud. There is also a configuration area where you can change fonts and colours, you can also change the layout of the text as well.&lt;/p&gt;  &lt;p&gt;My first Wordle I created was from my blog and its fair to say that there are some rather geek speak words, that I use when blogging. My more recent posts have all been around controls in Silverlight and the words such as control and template and heavily referenced when talking around these topics. So that was nice and simple to create and the results are cool. What I thought would be interesting is how this text cloud compares to the text cloud that represents what bookmarks and tags that I use on my del.icio.us account.&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Wordle_1023A/wordle%20my%20delicious%20tags_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/Wordle_1023A/wordle%20my%20delicious%20tags_thumb.png" style="border-width:0px;margin:10px 5px 10px 10px;" alt="wordle my delicious tags" align="right" border="0" height="456" width="644"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The results were interesting as the words that I have chosen for my tags are representative of the subject titles that encapsulate the technology areas that I write about on my blog.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;I also tried out the Conchango blogs site and its corresponding del.icio.us tags which produced very similar results. All the Wordle links are posted at the bottom of the post if you want to view them or you can create your own in seconds.&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;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://wordle.net/gallery/wrdl/95152/conchango_tags" title="Wordle: conchango tags"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;/blockquote&gt; &lt;a href="http://wordle.net/gallery/wrdl/95146/tags" title="Wordle: tags"&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://wordle.net/gallery/wrdl/95140/my_blog" title="Wordle: my blog"&gt;&lt;img src="http://wordle.net/thumb/wrdl/95140/my_blog" style="padding:4px;"&gt;&lt;/a&gt;&lt;img src="http://wordle.net/thumb/wrdl/95152/conchango_tags" style="padding:4px;"&gt; &lt;a href="http://wordle.net/gallery/wrdl/95152/conchango_tags" title="Wordle: conchango tags"&gt;&lt;/a&gt;&lt;a href="http://wordle.net/gallery/wrdl/95116/Conchango_blogs" title="Wordle: Conchango blogs"&gt;&lt;img src="http://wordle.net/thumb/wrdl/95116/Conchango_blogs" style="padding:4px;"&gt;&lt;img src="http://wordle.net/thumb/wrdl/95146/tags" style="padding:4px;"&gt;&lt;/a&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=12067" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=0eC6h2-FQaI:j838WkywVCQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=0eC6h2-FQaI:j838WkywVCQ:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=0eC6h2-FQaI:j838WkywVCQ:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=0eC6h2-FQaI:j838WkywVCQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=0eC6h2-FQaI:j838WkywVCQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Musings/default.aspx">Musings</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/07/30/wordle-text-clouds.aspx</feedburner:origLink></item><item><title>Silverlight Tweening Adventures with Baby Smash!</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/UWX3C4MROxI/silverlight-tweening-adventures-with-baby-smash.aspx</link><pubDate>Wed, 23 Jul 2008 14:32:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:11965</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/11965.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=11965</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=11965</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/BabySmashScreen_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/BabySmashScreen_thumb.png" style="border-width:0px;margin:10px 10px 10px 5px;" alt="BabySmashScreen" align="left" border="0" height="484" width="594"&gt;&lt;/a&gt;Before starting out&amp;nbsp; on my tweening adventures I have to admit too being complete tweening newbie. On previous WPF and Silverlight projects animations were rolled from scratch to provide the desired responses to changes in the applications state. With regards to Designer and Developer workflow this&amp;nbsp; stage of the process is usually where the 2 worlds collide. The developer adding animations in code behind hand cranking; Storyboards and animations; and dealing with event handlers. The designer is using Blend to create Timeline animations declared in Xaml. The other point to note is that Developers can't do animations, we may be able to code the equations and provide the necessary hooks for when event that happen when an animation finishes, but essentially the designer will have the last say in the matter with regards to the aesthetics of the animation created. My own experience is that we start with good intentions by putting all the animations in Xaml but this can become a little tricky when you have to deal with different states and trigger different animations. So this is when I fall back to putting all my animations together in a Resource Dictionary; and handling the state changes in code which fire the animations that the designer has created. The other problem that i have come across is when you have dynamic data data bound to an Items Control and you need to animate the different items based on their position in the Control, this simply can't all be done in Xaml and is a combination of Storyboards declared in Xaml and code behind to trigger the animations. In general animations can cause problems and I was also frustrated that these animations having to be hand rolled from &lt;a href="http://www.robertpenner.com/easing/easing_demo.html" target="_blank"&gt;&lt;/a&gt;scratch, this was evident when Felix asked if I would write some Silverlight animation code for him recently and while I was doing this all the memories of working with WPF and animations came flooding to mind at which point I thought that there must be a better way. I vaguely remembered reading an article on Silverlight Cream from &lt;a href="http://firstfloorsoftware.com/blog/" target="_blank"&gt;Koen&lt;/a&gt; over at first floor solutions and further back a post from &lt;a href="http://adamkinney.com/" target="_blank"&gt;Adam Kinney&lt;/a&gt;. If like me you are new to Tweening this is a great place to &lt;a href="http://firstfloorsoftware.com/blog/declarative-tweening-4/" target="_blank"&gt;start&lt;/a&gt; and is where my journey really begins. After reading the blog posts and looking over the other Tweening &lt;a href="http://www.pacem.it/CMerighi/Posts/66,en-US/Silverlight_Tweener.aspx" target="_blank"&gt;libraries&lt;/a&gt; from &lt;a href="http://www.pacem.it/CMerighi/Blog/en-US/Home.aspx" target="_blank"&gt;Cristian&lt;/a&gt; all of which are based on &lt;a href="http://www.robertpenner.com/" target="_blank"&gt;Robert Penner&lt;/a&gt; &lt;a href="http://www.robertpenner.com/easing/easing_demo.html" target="_blank"&gt;equations&lt;/a&gt; I was feeling confident that I could use this code and start to tackle my first problem. Animating &lt;a href="http://www.hanselman.com/babysmash/" target="_blank"&gt;Baby Smash!&lt;/a&gt; shapes.&lt;/p&gt;  &lt;p&gt;After helping &lt;a href="http://www.hanselman.com/blog/" target="_blank"&gt;Scott&lt;/a&gt; with some other parts of Baby Smash! we started talking about how to animate the different shapes that &lt;a href="http://blogs.conchango.com/felixcorke/default.aspx" target="_blank"&gt;Felix&lt;/a&gt; had created. We discussed the above and based on the outcome I decided to use tweening rather than hand cranking the animations from scratch, but I wanted to do something that would &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/Tweening%20code%20Xaml_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/Tweening%20code%20Xaml_thumb.png" style="border:0px none;margin:10px 5px 10px 10px;" alt="Tweening code Xaml" align="right" border="0" height="484" width="627"&gt;&lt;/a&gt;not only work in Silverlight but also in WPF, this is where Koens' Library solved my problem. I download his simple Silverlight application which shows off some of the basic features available in the Tweening Library and put in some additional tweaks to the UI allowing for more control over the different Transfroms which we can use in Xaml. We have a bunch of different transforms available in Silverlight, which include; RenderTransform; ScaleTransform; RotateTransform; and SkewTransform. Not only did I want to be able to play with tweens for each Transform type I also wanted to allow users to change the values for their selected transform, for example the Scale Transform supports Scaling on the X and Y axis so there are sliders which can be used to change the values from and to which the tween will use to animate the Scale tween selected. &lt;/p&gt;  &lt;p&gt;Scott is building Baby Smash! mainly using code behind, and I can understand the attraction of heading for the code behind as this is what we feel comfortable cranking. From personal experience when building WPF applications burying goo in the code behind is not always that best thing especially when you are building interactions for the user. These interactions will have an impact on the designer and if they are not in the Xaml then they can't help that easily, but also they are more willing to change Xaml than code behind. Keon solution fits well, it allows me to add the animations in Xaml and event handlers in the code behind, allowing the designer to tweak the animations to produce the desired effect.&lt;/p&gt;  &lt;p&gt;So now we have away to play around with the different tweens and how they effect the various Transforms, we can also hit the Xaml button and get the Xaml required to recreate the Storyboard. The next job is to get everything working in WPF. I created a new WPF assembly and stuck Keons' library in. Next up add a reference from Baby Smash! project to the tweener project. Find the User Control shape that I want to change and add this code into the Resources collection of the Grid we also need to add the RenderTransformOrigin and set the value. Finally I needed to add the Render, Rotate, Scale and Skew transform to the Transform group collection of the grid.&amp;nbsp; Hit F5 and i get to see my shape and the tween animation that I created in the Silverlight app.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/FigureGenerator_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/FigureGenerator_thumb.png" style="border:0px none;margin:10px 10px 10px 5px;" alt="FigureGenerator" align="left" border="0" height="389" width="644"&gt;&lt;/a&gt;There are a couple of problems with my approach; first is that we are duplicating the tweening code in all the User Controls; and second problem is randomness, if I want to keep the equation applied to the shape but randomly change the from and to values this is currently not possible. I style may help here as Styles support animations, however I am referencing UI Elements that are in the Grid and this could cause some issues with regards to Scoping. My other choice is to add the animations into another Xaml file and use a Resource Dictionary. Keons' Library is best used inside a Control Template, however the Baby Smash! shapes are User Controls which contain a layout grid that hosts other UI Elements unfortunately these controls do not inherit from Control and thus I am unable to use the Control Template. As I could not make a decision I thought that I would attempt both the Style route and the Resource dictionary. I created an empty style for the layout root grid and moved the tweening Xaml into here, and that is about as far as it went, I got an exception at runtime complaining that it could not find the target. This is the scoping issue that mentioned earlier as the UI Element that we want to target is&amp;nbsp; out of scope. So next up is the Resource Dictionary. I created the Resource Dictionary in Blend and moved the tweening Storyboard into the Resource Dictionary, final part in Xaml is to just add in a reference from within the User Controls Resources collection to the new Resource Dictionary. Using this mechanism means that I have to trigger the tween for each shape from code behind, but its only a couple of lines. In Baby Smash! the figure generator is where most of the action takes place so in there I added some code to kick off the animation for shape. I have now replaced the duplicate code with a single Storyboard that we have in the Resource Dictionary, cool, but what about Random changing of the tweening easing functions and input values ? To implement this part I iterate over all the Children which in this case are DoubleAnimationUsingKeyFrames and call on of the Utility methods in Baby Smash! to get two random numbers generated.&amp;nbsp; To change the other values we can simply add the other static method calls to change the inputs on the tween. So I guess the next question really is "What would it have taken to do it all in code behind ?? "&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/Tweeing%20code%20only_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightTweeningAdventureswithBabySma_298/Tweeing%20code%20only_thumb.png" style="border:0px none;margin:10px 5px 10px 10px;" alt="Tweeing code only" align="right" border="0" height="302" width="895"&gt;&lt;/a&gt; You can see that if we go with all the animation tweening in code behind then it looks like this, yeah that's all it takes to get the animation working. By creating the Storyboards in code behind we loose the Verbose qualities of Xaml but we also loose the designer. My current thoughts are that if you have a number of UI Elements that you want to animate and these animations are pre baked by the Designer, go for the Xaml route. However, if you are looking for a solution to either dynamic items in an Items Control or you are looking to do something which is similar to Baby Smash! go with the code behind.&lt;/p&gt;  &lt;p&gt;While I was building this code &lt;a href="http://blogs.msdn.com/devdave/" target="_blank"&gt;Dev Dave&lt;/a&gt; and &lt;a href="http://scorbs.com/" target="_blank"&gt;Scorbs&lt;/a&gt; put together the &lt;a href="http://scorbs.com/2008/07/17/flickrviewr-using-devdaves-animatingwrappanel/" target="_blank"&gt;FlickrViewr&lt;/a&gt; using the Animating Wrap Panel and Robbie updated his &lt;a href="http://nerdplusart.com/" target="_blank"&gt;site&lt;/a&gt; and also posted a great post on animating &lt;a href="http://labs.nerdplusart.com/#AnimatingPanelBase" target="_blank"&gt;panels&lt;/a&gt;. So the next job is to take Dev Daves' AWP and change his interpolations with Penners' Equations. I have got pretty far with this but I have a performance tweak that I would like to make before posting the source. What I am hoping to build is a versatile AWP where you can easily say in Xaml what tweening easing equation you want to use along with the inputs. You can download all the source from my &lt;a href="http://cid-118ee1873690fc1d.skydrive.live.com/browse.aspx/SL2B2%20Demos" target="_blank"&gt;SkyDrive&lt;/a&gt; or you can load up the URL and have a play with the app &lt;a href="http://demo.conchango.com/MyTweenerTestWeb/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=11965" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=UWX3C4MROxI:lBNiIHOh8nM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=UWX3C4MROxI:lBNiIHOh8nM:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=UWX3C4MROxI:lBNiIHOh8nM:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=UWX3C4MROxI:lBNiIHOh8nM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=UWX3C4MROxI:lBNiIHOh8nM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/07/23/silverlight-tweening-adventures-with-baby-smash.aspx</feedburner:origLink></item><item><title>Silverlight Nuggets</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/XWUf19T9eGk/silverlight-nuggets.aspx</link><pubDate>Tue, 15 Jul 2008 08:53:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:11841</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/11841.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=11841</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=11841</wfw:comment><description>&lt;p&gt;If like me you are following the &lt;a href="http://silverlight.net/default.aspx" target="_blank"&gt;Silverlight&lt;/a&gt; trail, you are more than likely to be reading &lt;a href="http://silverlightcream.com/" target="_blank"&gt;Silverlight Cream&lt;/a&gt; and the &lt;a href="http://www.silverlightshow.net/Default.aspx" target="_blank"&gt;Silverlight Show&lt;/a&gt; and their daily posts which provide a great way to stay on top of the daily Silverlight news. Not only &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/Silverlightnuggets_4.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/Silverlightnuggets_thumb_1.png" style="border:0px none;margin:10px 10px 10px 5px;" alt="Silverlightnuggets" align="left" border="0" height="164" width="244"&gt;&lt;/a&gt;do I subscribe to this sites via RSS but also their &lt;a href="http://twitter.com/home" target="_blank"&gt;twitter&lt;/a&gt; feeds which I take advantage of as my RSS reader tends to get a little swamped with unread posts. I have yet to reach this stage with Twitter I am sure the time will come but for the moment the new entries appear in &lt;a href="http://www.twhirl.org/" target="_blank"&gt;twhirl&lt;/a&gt; and its a joy to go and instantly have a read of the news. Recently, I have been posting about styles and control templates in Silverlight 2 Beta 2 &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/tabcontrol_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/tabcontrol_thumb.png" style="border:0px none;margin:10px 5px 10px 10px;" alt="tabcontrol" align="right" border="0" height="214" width="331"&gt;&lt;/a&gt;and posting up the code for other people to take a look and comment on. Over the weekend Rajeev from Silverlight Nuggets contacted me asking if I would be interested in posting my source up onto the site, which I gladly agreed too. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlightnuggets.com/" target="_blank"&gt;Silverlight Nuggets&lt;/a&gt; is a great site built using Silverlight which hosts working demos of Silverlight controls and styles that you can find on the Internet. There is a complete listing of the controls that you can dig into with a brief overview of what each UI control does. Once you have found the control that you would like grok there are a range of different community&amp;nbsp; built styles that have been built. You can select the individual styles and view live what they look like and more importantly interact with the controls. All this is great but Silverlight nuggets also pull apart the Visual tree for the styles and control templates use d in the &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/viewing%20the%20visual%20tree%20of%20the%20control_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SilverlightNuggets_8253/viewing%20the%20visual%20tree%20of%20the%20control_thumb.png" style="border:0px none;margin:10px 10px 10px 5px;" alt="viewing the visual tree of the control" align="left" border="0" height="484" width="387"&gt;&lt;/a&gt;sample so that you can get an in-depth view of the UI controls used to create the visual metaphor. Awesome.. &lt;/p&gt;  &lt;p&gt;If you are building styles and control templates in Silverlight 2 Beta 2, Silverlight Nuggets is a great place to share you code.&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=11841" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=XWUf19T9eGk:1oVhAbajGoM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=XWUf19T9eGk:1oVhAbajGoM:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=XWUf19T9eGk:1oVhAbajGoM:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=XWUf19T9eGk:1oVhAbajGoM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=XWUf19T9eGk:1oVhAbajGoM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/07/15/silverlight-nuggets.aspx</feedburner:origLink></item><item><title>Skinning Controls in Silverlight 2 Beta 2 - Introducing the TabControl, TabPanel and TabItem</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/JnaAiVRYE9s/skinning-controls-in-silverlight-2-beta-2-introducing-the-tabcontrol-tabpanel-and-tabitem.aspx</link><pubDate>Wed, 09 Jul 2008 17:09:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:11751</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/11751.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=11751</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=11751</wfw:comment><description>&lt;p&gt;With the new release of &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; 2 Beta 2 came a new drop of controls that allow the designer and developer to build tabbed content that we have become used to, the TabControl, TabPanel and TabItem don't reside in the standard Silverlight Controls assembly but live in the System.Windows.Controls.Extended assembly. After reading &lt;a href="http://www.timheuer.com/blog/" target="_blank"&gt;Tim&lt;/a&gt; Heuer's &lt;a href="http://www.timheuer.com/blog/archive/2008/06/04/silverlight-2-introduces-tabcontrol.aspx" target="_blank"&gt;post&lt;/a&gt; about the TabControl and not having used the controls before I thought that it was about time I got to know these new controls.&lt;/p&gt;
  
&lt;p&gt;To create a simple TabControl you can drag the TabControl from the toolbar in Blend and drop it on to your canvas and resize the control to your requirements, next select the TabItem control, making sure your TabControl is selected double click the TabItem on the toolbar and you can add in as many Tabs as you require, nice and easy. This is the simplest tabbed control you can build. But what happens if you want to change the style and template of the control to come in line with your applications skin ?? In a previous &lt;a href="http://blogs.conchango.com/richardgriffin/archive/2008/06/24/skinning-controls-in-silverlight-2-beta-2.aspx" target="_blank"&gt;post &lt;/a&gt;I covered skinning a ListBox Control and its visual elements, in this post I will attempt to cover the tabbed controls that are available in Beta 2.&lt;/p&gt;
  
&lt;p&gt;When we want a higher level of control of the TabControl and its items we need to create our own custom Style and Control Templat&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabControlTemplate_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabControlTemplate_thumb.png" style="border:0px none;margin:10px 5px 10px 15px;" alt="TabControlTemplate" align="right" border="0" height="139" width="244"&gt;&lt;/a&gt;e for the TabControl and TabItem's. In Blend select your TabControl and from the Object menu option select edit style and select the&amp;nbsp;&amp;nbsp; create empty sub menu option, I called mine &lt;i&gt;MyTabControlStyle,&lt;/i&gt; we then get to see our new style which is rather plain as it is empty, so lets move on and edit the UI elements of the TabControl template. Select the style in the object tab and right click and edit the control parts template, and select the Edit a copy option, I called mine &lt;i&gt;MyTabControlTemplate&lt;/i&gt; calling the style and the associated control template is the standard naming convention that I use so that it it easy to keep track of what templates belong to what styles and vice versa. Now if you check out your TabControl you will find that what once looked like a TabControl now looks nothing like a TabControl, the reason behind this is because we have just changed the style of the control and its template both of which are empty. What need to do is workout what the UI elements we want to use so that we can create the required design.&amp;nbsp; The first UI &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/simple%20tab%20control%20template%20and%20style_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/simple%20tab%20control%20template%20and%20style_thumb.png" style="border:0px none;margin:10px 15px 10px 5px;" alt="simple tab control template and style" align="left" border="0" height="173" width="244"&gt;&lt;/a&gt;Element that we need to add is a grid to hold all the other UI Elements. Once we add the grid into the control we then also get the different common states that are supported by the control template. In this case the Common States are Normal and Disabled. Next UI control too add into the control template is the TabPanel control. The TabPanel control provides a container where the TabItem's will live, therefore the TabPanel plays host to our TabItem's. Next up is our Border UI element for the control. Next and most importantly is the ContentControl for the content that will be displayed by each TabItem added into the TabControl. &lt;/p&gt;
  
&lt;p&gt;When you add the ContentControl to the control template it will automatically create the template bindings for you. You can change these settings in Blend &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/templatebinding_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/templatebinding_thumb.png" style="border:0px none;margin:10px 5px 10px 10px;" alt="templatebinding" align="right" border="0" height="244" width="220"&gt;&lt;/a&gt; when you have the ContentControl selected you will see that there are yellow squares next to the group that is bound. When you select the square you will get a popup where and at the bottom is a template binding option with a bunch of submenu options that you can choose based on what you want to bind up to. The TabPanel part of the control template can be used to change the size of the TabItems that are hosted inside so that you can easily change the height and placement of the TabPanel and this layout will effect the TabItems hosted inside.&lt;/p&gt;
  
&lt;p&gt;The next step is to move on to the TabItem, follow the same steps again by creating a style and then the template. Once you have you empty control template ready its time to add the UI elements that we want to the template. First off add a Grid to host all the other visual elements we are going to add. Next add in a border for the outer part of the TabItem. Inside the outer border add a second border which we animate when the user mouse's over the TabItem. To this border we need to a grid that will host a rectangle for t&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabItemControl%20template_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabItemControl%20template_thumb.png" style="border:0px none;margin:5px 10px 0px 0px;" alt="TabItemControl template" align="left" border="0" height="219" width="244"&gt;&lt;/a&gt;he selected background when the TabItem is selected we also need to add a Content Control that will host the Header content of the TabItem. Now we have the basic structure in place for the TabItem we can start to customise the tab and create the design required.&amp;nbsp; &lt;/p&gt;
  
&lt;p&gt;&lt;i&gt;There is a gotcha here which caused me some pain for a while. The TabItem design that I wanted to build was a tab which has rounded corners and positioned slightly above the content rendered in the TabControl Content area very similar to the TabItem controls in Blend. After a number of attempts at building the TabItem control template I could not get the design that I wanted as the background of the control would not rendered correctly after it had been selected. So even though the UI element rendered correctly when the page loaded once you had selected the TabItem and selected another TabItem in the TabPanel the Look and Feel changed as the background had changed to the background of the TabItem's root element. This was very unexpected behaviour as&amp;nbsp; you can see the TabBorder lives within a Grid and something somewhere was changing the background colour of the grid to be the background colour of the TabItem. What the problem turns out to be is the naming of the controls in the Control Template. I had named each of the Visual Elements the same as the default TabItem Control Template, based on the help that I found in the docs. It turns out that there is some code in Silverlight that deals with the TabItem which uses margins to move the TabItem and in here the code looks for the default names of the UI elements to perform these interactions. Therefore by changing the names of the UI elements this solved all my problems. &lt;/i&gt;&lt;/p&gt;
  
&lt;p&gt;When building the TabItem you will want to set the UI elements width and height to&amp;nbsp; Auto, however this is not great when your are trying to get the look and feel that you want for your TabItem, personally I make the control larger until I have a layout that is close to the design, t&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabControlskin_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2Intro_BBA6/TabControlskin_thumb.png" style="border:0px none;margin:10px 5px 10px 10px;" alt="TabControlskin" align="right" border="0" height="231" width="367"&gt;&lt;/a&gt;hen reset everything back to auto before building the solution. Once you have all the elements in place and the layout you want then next it's time to add in the interaction animations for the different states of the control. The TabItem has&amp;nbsp; a number of different states that we can wire up to. The first state I am going to wire up to is the MouseOver. In Blend select the MouseOver State from the state tab and select the TabItemInnerBorder UI element, and change this to the colour of your choice. Then repeat the same steps for the other visual states that you want to change. I went for a different coloured background for each different state, to give hints to the user the image on the right screen shot of the final design where the first tab is in a selected state, second tab has a MouseOver state and the third tab is in a normal state. &lt;/p&gt;
  
&lt;p&gt;
You can download the styles and templates from my skydrive folder.
&lt;iframe src="http://cid-118ee1873690fc1d.skydrive.live.com/embedrow.aspx/SL2B2%20Demos" style="margin:3px;padding:0pt;width:240px;height:26px;" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=11751" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=JnaAiVRYE9s:VgHFfnI5qQA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=JnaAiVRYE9s:VgHFfnI5qQA:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=JnaAiVRYE9s:VgHFfnI5qQA:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=JnaAiVRYE9s:VgHFfnI5qQA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=JnaAiVRYE9s:VgHFfnI5qQA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/07/09/skinning-controls-in-silverlight-2-beta-2-introducing-the-tabcontrol-tabpanel-and-tabitem.aspx</feedburner:origLink></item><item><title>Skinning Controls in Silverlight 2 Beta 2</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/kC68cL37BSc/skinning-controls-in-silverlight-2-beta-2.aspx</link><pubDate>Tue, 24 Jun 2008 12:22:28 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:11551</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/11551.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=11551</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=11551</wfw:comment><description>&lt;p&gt;With the new release of Beta 2 and Blend skinning of Silverlight controls has improved dramatically. Rather than hand cranking these due to no support at all in the previous version of Blend, you can now change templates and styles from within Blend rather than cranking the Xaml yourself. Not that I don't like cranking Xaml by hand but better tool support means that you are more productive and it also becomes more accessible to designers who are not interested in cranking pages of Xaml.&lt;/p&gt;  &lt;p&gt;Recently I have been upgrading some of the work we have been doing in Beta 1 to Beta 2 and this time round I am concentrating on skinning and templating of controls. I will post soon about my experiences in doing this but in the meantime &lt;a href="http://blogs.msdn.com/corrinab/" target="_blank"&gt;Corrina Barber&lt;/a&gt; is updating her skins for &lt;a href="http://blogs.msdn.com/corrinab/archive/2008/06/16/8602865.aspx" target="_blank"&gt;Beta 2&lt;/a&gt; which is where I am sourcing my information.&amp;#160; &lt;a href="http://timheuer.com/blog/" target="_blank"&gt;Tim Heuer&lt;/a&gt; has a great post on &lt;a href="http://timheuer.com/blog/archive/2008/06/04/skinning-silverlight-controls-made-easier.aspx" target="_blank"&gt;skinning&lt;/a&gt; controls in Beta 2, in the Tim's post he illustrates how we can edit templates of a Scroll Bar and then start to change the composite parts that make up the Scroll Bar. In this post I want to take Tim's example a little further and illustrate a couple of areas that are worth noting when skinning controls.&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/resourcestab_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 0px 15px 15px;border-right-width:0px;" height="89" alt="resourcestab" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/resourcestab_thumb_2.png" width="243" align="right" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So once you have decided to change the template of the Scroll Bar you may want to go back and make some further tweaks, the way in which you can do this is by selecting the Resources tab and selecting your style for the Scroll Bar, in this instance I have called mine TestScrollBarStyle (not very elaborate I know). Also listed in the Resources tab you will see all you other styles and templates that you have created specific to your application. By putting your resources into the App.xaml file this helps leverage the separation of concerns between the designer and the developer, allowing the developer to work on other controls and code behind, and freeing the designer to create skins for the controls that have a global effect on the UI elements used in the application. Once you have found the style or template that you want to edit we need to select this and start to work on tweaking the design. We edit these by double clicking on the &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Editing%20scrollbar%20res_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:15px 0px 0px;border-right-width:0px;" height="28" alt="Editing scrollbar res" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Editing%20scrollbar%20res_thumb.png" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160; icon at the far right hand side which will then display the Scroll Bar, which looks just like the standard Scroll Bar. &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/TestScrollBar_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:10px 0px 15px 15px;border-right-width:0px;" height="171" alt="TestScrollBar" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/TestScrollBar_thumb_1.png" width="644" align="right" border="0" /&gt;&lt;/a&gt;You may now have noticed that as we are editing the style of Scroll Bar there are no other controls listed in the objects tab. So how do you edit the style ?? What we need to do here is ensure that the Style is selected and then right click on the selected style, then select the Edit Control Parts option and under this &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Edit%20scroll%20bar%20template_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:20px 10px 10px 0px;border-right-width:0px;" height="244" alt="Edit scroll bar template" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Edit%20scroll%20bar%20template_thumb.png" width="186" align="left" border="0" /&gt;&lt;/a&gt;option select the Edit Template option. You will now see all the composite UI Control templates that are used to create a Scroll Bar. Also notice that we have moved from the editing a Style to editing a Template. &lt;/p&gt;  &lt;p&gt;We now have the option of editing the templates to change the look and feel of the Scroll Bar. Lets follow Tim's example and change the skin of the Thumb template. Select the Horizontal Thumb template from the objects tab and edit the controls template. Blend now shows you all the UI Elements that make up the Thumb template, including animations and colours used on the UI elements required to deliver the behaviours of a Scroll Bar. So while we are here we can change the UI elements that we want for the Scroll Bar and change the animations and colours being used. We should now have a new visual design of the Scroll Bar, cool that was not too difficult for us to achieve.&lt;/p&gt;  &lt;p&gt;What is happening in the Xaml ?? Well what we can see is that we have changed the Horizontal Thumb template that lives within our style for the Scroll Bar and when we view the ListBox that is using this particular style we can see our new visual design being used, however we are only seeing our new design on the template that we updated, more than likely this will be the Horizontal template. This is because we have only update the template for the Horizontal Thumb and we have not yet changed the Vertical Thumb. So we could, either copy and paste the contents of the Horizontal template into the Vertical template or we may want to have a completely different design for the Vertical Thumb. Personally I don't like either of those options, as a developer I like to read beautiful code and one of the tenants of beautiful code is based around DRY (Don't Repeat Yourself) and having 2 different skinned Scroll Bars I think would be confusing. So how do we resolve this issue ?? In our application we are likely to have many controls that derive from Items Control and we want a consistent look and feel to the Scroll Bar and in this particular case the Horizontal and Vertical Thumb.&lt;/p&gt;  &lt;p&gt;The solution to the problem is to create a Style that we can apply to many different Thumb Templates. So how do we do this ??&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Create%20thumb%20style_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:25px 0px 10px 10px;border-right-width:0px;" height="162" alt="Create thumb style" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/Create%20thumb%20style_thumb.png" width="244" align="right" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the previous steps we changed the template associated with the Thumb, what we actually want to do is change the style and to do this there is an option which is not all that intuitive to find. Select the Horizontal Thumb template and then move up onto the main menu&amp;#160; options where you will see an option called Object, select this option and towards the bottom you will see called Edit Style, select this option and then select the Edit Style option from the sub menu listing. You will then be prompted to create a new Thumb Style. &lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/editing%20the%20thumb%20style_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:15px 15px 10px 0px;border-right-width:0px;" height="116" alt="editing the thumb style" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/editing%20the%20thumb%20style_thumb.png" width="244" align="left" border="0" /&gt;&lt;/a&gt; We now see our new style, to edit the style we need to change the template and we do this by selecting the style in the objects tab, right click and edit the template associated with the style. We now see the UI elements associated with the template that we can change to be the visual design we want.&lt;/p&gt;  &lt;p&gt;Once you have modified the layout controls, colours and animations that you want we need to associate this new style with the Horizontal and Vertical Thumb control templates that we edited earlier in the Scroll Bar style. In the resources tab select your Scroll Bar style and edit the template so that we move down to the composite control templates that are used to create the Scroll Bar. Select the Horizontal Thumb template and right click,&amp;#160; rather than selecting the edit template select the apply resource option, in the sub menu options will be the new Thumb style that we created previous select the resource and this will apply your new Thumb style to the Horizontal Thumb. Repeat the same steps to associate the Vertical Thumb Control template with your new style.&lt;/p&gt;  &lt;p&gt;The final part is to ensure that you are no longer using the Horizontal Thumb control template but using your new style, so you may not see your new Thumb Style, we need to modify some Xaml to do this. The highlighted line below is what we need to change. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/modify%20the%20xaml_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:10px 10px 10px 0px;border-right-width:0px;" height="75" alt="modify the xaml" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/modify%20the%20xaml_thumb.png" width="1028" align="left" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As we can see from the Xaml the Thumb has been wired up to the Style that we created, but it is also wired up to the template that we created earlier on. We need to remove the reference to the Template and let the style do its job. Once this is done we will then see our new Thumb.&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/new%20thumb_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 0px 0px 70px;border-right-width:0px;" height="117" alt="new thumb" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/new%20thumb_thumb.png" width="244" align="right" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/final%20listbox_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 20px 0px 0px;border-right-width:0px;" height="320" alt="final listbox" src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/SkinningControlsinSilverlight2Beta2_916A/final%20listbox_thumb.png" width="644" align="left" border="0" /&gt;&lt;/a&gt;We can do the same to all the other Templates that constitute the Scroll Bar style and reuse them across the application, allowing the design to build a consistent theme for the application in complete separation to the developer. If there is enough demand from readers then I would be happy to do a screen cast if this makes it easier.&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=11551" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=kC68cL37BSc:1ZFAgoeYN98:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=kC68cL37BSc:1ZFAgoeYN98:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=kC68cL37BSc:1ZFAgoeYN98:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=kC68cL37BSc:1ZFAgoeYN98:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=kC68cL37BSc:1ZFAgoeYN98:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/06/24/skinning-controls-in-silverlight-2-beta-2.aspx</feedburner:origLink></item><item><title>Upgrading from Silverlight Beta 1 to Beta 2</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/_4OI0rT_sSY/upgrading-from-silverlight-beta-1-to-beta-2.aspx</link><pubDate>Fri, 13 Jun 2008 13:42:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:11448</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/11448.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=11448</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=11448</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.conchango.com/felixcorke/default.aspx" target="_blank"&gt;Felix&lt;/a&gt; and I have been presenting around Europe at the Remix Essentials events giving away a white labelled Silverlight mashup. Being on the Silverlight TAP I have been trying to keep the project up to date with the latest drops but fell behind. So while in Mexico on the Friday evening I thought that I would try and do a simple upgrade to Beta 2.&lt;/p&gt;  &lt;p&gt;So for those of you out there that have not seen the presentation I have put the complete deck up on my public &lt;a href="http://cid-118ee1873690fc1d.skydrive.live.com/browse.aspx/Remix%20Slide%20Deck" target="_blank"&gt;SkyDrive&lt;/a&gt; area so you can take a look at the deck. However, I will give you a little more background about the application. Felix and myself wanted to build a simple Silverlight mashup so that we could gain a better understanding of Beta 1 and how we could bend it. My other goals were to try out a simple testable pattern based on an MVP approach; and make the entire app a white labelled application so that people who have not done Silverlight before can easily change the endpoints and change the skin of the application so that they could get up to speed quickly with Silverlight. The idea was that this would be attractive to developers and designers so that it would act as a stepping stone to try out the technology and the workflow required to build an application.&lt;/p&gt;  &lt;p&gt;So lets open the Beta 1 solution and see what happens. Visual Studio works out that my copy is using the older Beta 1 version and politely asks me if I wish to upgrade the solution to Beta 2. The solution loads up with all the correct bindings in place so I hit F5 and watch the output window for errors.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-08_1435_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-08_1435_thumb.png" style="border-width:0px;" alt="upgrade" border="0" height="146" width="387"&gt;&lt;/a&gt;&amp;nbsp; The only compilation issue was about the multi scale image control. Checking the documentation you will find a section on breaking changes for Deep Zoom and the multi scale image control.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-08_1446_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-08_1446_thumb.png" style="border-width:0px;" alt="MSI Change" border="0" height="194" width="644"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;and&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-09_1111_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/2008-06-09_1111_thumb.png" style="border-width:0px;" alt="DZ Collections format change" border="0" height="339" width="644"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After making these changes build the app. Green light cool. &lt;/p&gt;  &lt;p&gt;Next its time to change the Deep Zoom Compositions which I created for Denmark and Austria, forgot my camera in Dublin and Mexico :-(&lt;/p&gt;  &lt;p&gt;So open up&amp;nbsp; the old files and simply make sure that the composition option and output as files options as selected, then hit the export. Once this was done copy over the goo and drop them into the ClientBin. To get a definitive list of new stuff check out the &lt;a href="http://blogs.msdn.com/expression/archive/2008/06/07/what-s-new-in-deep-zoom-composer.aspx" target="_blank"&gt;Expression team blog&lt;/a&gt;. Once that's done the final part is to update the code.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Beta 1&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;case Model.RemixEvents.Denmark:      &lt;br&gt;{       &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.DeepZoom.Source = new Uri(this.remixDenmarkSource);       &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;       &lt;br&gt;}&lt;/p&gt;    &lt;p&gt;Beta 2&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;case Model.RemixEvents.Denmark:      &lt;br&gt;{       &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.DeepZoom.Source =       &lt;br&gt;&amp;nbsp;&amp;nbsp; new DeepZoomImageTileSource(new System.Uri(this.remixDenmarkSource));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp; break;       &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So far so good, no real pain to be had.&lt;/p&gt;  &lt;p&gt;The mashup contains a simple User Control to wrap up all the functionality of a deep zoom view and the corresponding View Model that contains all the logic for the view, such as filtering of images and working out which image in the collection has been selected. Curious of the new Deep Zoom Composer and wanting to interact with the new UI and its features, I decided to create a dummy project and see what happens. I find that with new technology it best to start real simple and then layer on the complexity so I created a new simple project with 2 images and left all the defaults in place. View the collection using the in browser option and the collection appeared ready for action. Cool... &lt;/p&gt;  &lt;p&gt;Then select the open in Blend option ready to create the filtering GUI to test out the filter as this code needs to change to come inline with the new metadata.xml file that the DZC auto gens for us. &lt;/p&gt;  &lt;p&gt;Unfortunately, I was getting an error as the project file which opens is incorrect. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/blenderror_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/blenderror_thumb.png" style="border-width:0px;" alt="blenderror" border="0" height="102" width="644"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you use the default values you will get something like DeepZoomOutput.sln that DZC has asked it to open. However, it should be DeepZoomProject.sln. Not a biggie but a little frustrating when you want the process to be a seamless one. Ok I thought open everything up in VS08 just in case there is a problem with the new version and VS will usually give you better debug information at Runtime. So I open the project with no errors and hit F5. I get a Xaml error in the browser.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/XamlErrorinbrowserfromVS_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/XamlErrorinbrowserfromVS_thumb.png" style="border-width:0px;" alt="XamlErrorinbrowserfromVS" border="0" height="484" width="562"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My next stop is to right click on the html file and select the view in browser option, the Browser starts up and loads up my Silverlight goo with no errors. On closer inspection the clue is in the URL which is given to the browser hitting F5 it was :-&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\Projects\ConchangoLabs\DeepZoomFilter\FitlerExample\Collection\ascollection\DeepZoomProject\Bin\Debug\TestPage.html&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;However if you right click and say view in browser it references the webdev server instance :-&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp;&lt;a href="http://localhost:56724/DeepZoomProjectWeb/ClientBin/DeepZoomProjectTestPage.html" title="http://localhost:56724/DeepZoomProjectWeb/ClientBin/DeepZoomProjectTestPage.html"&gt;http://localhost:56724/DeepZoomProjectWeb/ClientBin/DeepZoomProjectTestPage.html&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The way around this is to make the web site your startup app and make the .html page your start page and say yes to debugging support for Silverlight and all is well again. &lt;/p&gt;  &lt;p&gt;The video plays and the Deep Zoom Collections are loaded into the User Control and my interactions still work. However I am still not getting any data. Strange after checking all my bindings and everything is looking good. So debugging the page around the where I bind up my data and find that Silverlight is barfin' with an UnauthorizedAccessException, due to cross-threaded access. The threading model in Beta 2 has changed, and the Invalid cross-threading exception is due to the code trying to update the UI while still on the background thread. So we need to marshal back on to the UI thread and update the control with the new data from the response stream. After a bit more digging I found a couple of recent posts by Scorbs on WebClient and HttpWebRequest changes in Beta 2 &lt;a href="http://scorbs.com/2008/04/05/silverlight-http-networking-stack-part-1-site-of-origin-communication" target="_blank"&gt;here&lt;/a&gt;. So my next job is to change the way in which I update the UI from within the ModelView for that View. The original code looked like this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/original%20code%20HttpRequestCallback_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/original%20code%20HttpRequestCallback_thumb.png" style="border-width:0px;" alt="original code HttpRequestCallback" border="0" height="396" width="644"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In WPF we have something called the Dispatcher, which allows us to do a BeginInvoke and add the UI work we want to do into the queue for the UI thread to process depending on the priority that we sent, if you are not familiar then &lt;a href="http://www.drwpf.com/blog/Default.aspx?base" target="_blank"&gt;Dr WPF&lt;/a&gt; has a good &lt;a href="http://www.drwpf.com/blog/Home/tabid/36/EntryId/28/Default.aspx" target="_blank"&gt;article&lt;/a&gt; or check out &lt;a href="http://msdn.microsoft.com/en-us/library/ms741870.aspx" target="_blank"&gt;msdn&lt;/a&gt;. However, the Silverlight Beta threading model is not the same and the call to the Dispatcher's Begin Invoke takes only a delegate, so you can't set the priority of the work put into the queue. But doing the BeginInvoke is only part of the story and you don't actually need to do it in this particular case, what is important is to use the SynchronizationContext and call its Post method which takes a delegate and an Object. Cool however, there is a little gotcha we need to look out for. Although you can call the Current property on the SynchronizationContext it is not guaranteed to return you the context of the UI thread, so &lt;i&gt;SynchronizationContext.Current.Post(delegate, object)&lt;/i&gt; is not going to do the job. To get around this you need to grab the Context in the constructor of the main page. For example my start page looks like this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/SyncContextconstructor_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/SyncContextconstructor_thumb.png" style="border-width:0px;" alt="SyncContextconstructor" border="0" height="147" width="644"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Page.xaml.cs and in the constructor I am getting hold of the context and passing this into the constructor of my ViewModel, the ViewModel then will retain this reference so that all my other calls to add items to the UI queue will use this reference. It ends up looking like this. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/newcallback_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/newcallback_thumb.png" style="border-width:0px;" alt="newcallback" border="0" height="457" width="644"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The last bit of work to be done is to add the call to the BeginIvoke on the Dispatcher to update the UI now that we have a hold on the UI thread. Notice that as we are on the background thread it feels right to process all the data sent here rather than doing this work on the UI and blocking something that could be reducing the experience which the user is having.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/UIDelegate_2.png"&gt;&lt;img src="http://blogs.conchango.com/blogs/richardgriffin/WindowsLiveWriter/UpgradingSilverlightfromBeta1toBeta2_D299/UIDelegate_thumb.png" style="border-width:0px;" alt="UIDelegate" border="0" height="262" width="644"&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That was quite a lot to get through so you may want to go and grok this code a little before you crank your own, however before you do read on.&lt;/p&gt;  &lt;p&gt;Everything is building so I fire my app and sit back to wait and see my data in the control.... However nothing gets displayed. Strange... Well not really as there have been schema changes in Beta 2 the styles associated with my control nolonger work. So its time to jump into the Xaml and remove the associated styles from the ListBox. Build and run.... Whoa I see data in the ListBox. &lt;/p&gt;  &lt;p&gt;After changing each of the ViewModel's to use the same pattern as above it's time to start changing the controls styles which I will attempt in the next post about upgrading from Silverlight Beta 1 to 2.&lt;/p&gt;  &lt;p&gt; If you have come across any other gotcha's then I would like to hear about them.&lt;/p&gt;&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=11448" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=_4OI0rT_sSY:zVZAwjLi-wc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=_4OI0rT_sSY:zVZAwjLi-wc:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=_4OI0rT_sSY:zVZAwjLi-wc:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=_4OI0rT_sSY:zVZAwjLi-wc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=_4OI0rT_sSY:zVZAwjLi-wc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2008/06/13/upgrading-from-silverlight-beta-1-to-beta-2.aspx</feedburner:origLink></item><item><title>Getting ready for Mix07</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/7R5jv9Jd8Fc/Getting-ready-for-Mix07.aspx</link><pubDate>Fri, 27 Apr 2007 08:33:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:6766</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/6766.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=6766</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=6766</wfw:comment><description>Less than 24 hours to go and I will be on my way to Vegas for Mix07 . Last year Mix06 was a great success and after watching the channel 9 video "Mixin' it up with Beth and Ray" this year is going to be bigger and better. Unlike other Microsoft conferences...(&lt;a href="http://blogs.conchango.com/richardgriffin/archive/2007/04/27/Getting-ready-for-Mix07.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=6766" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=7R5jv9Jd8Fc:nVPU7liAGGQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=7R5jv9Jd8Fc:nVPU7liAGGQ:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=7R5jv9Jd8Fc:nVPU7liAGGQ:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=7R5jv9Jd8Fc:nVPU7liAGGQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=7R5jv9Jd8Fc:nVPU7liAGGQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Musings/default.aspx">Musings</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Mix/default.aspx">Mix</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2007/04/27/Getting-ready-for-Mix07.aspx</feedburner:origLink></item><item><title>Converting Dashboard Widgets to Sidebar Gadgets</title><link>http://feedproxy.google.com/~r/conchango/RichardGriffin/~3/CSXb9_YYnTM/Converting-Dashboard-Widgets-to-Sidebar-Gadgets.aspx</link><pubDate>Tue, 20 Mar 2007 10:40:00 GMT</pubDate><guid isPermaLink="false">e847c0e7-38d9-45c0-b593-56747303e088:6368</guid><dc:creator>Richard.Griffin</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.conchango.com/richardgriffin/comments/6368.aspx</comments><wfw:commentRss>http://blogs.conchango.com/richardgriffin/commentrss.aspx?PostID=6368</wfw:commentRss><wfw:comment>http://blogs.conchango.com/richardgriffin/rsscomments.aspx?PostID=6368</wfw:comment><description>Jamie and I were chatting yesterday morning about Vista Sidebar Gadgets when he sent me a link to the Sidebar Gadget Development MSDN Forum where chemgirl had posted a new thread " Can someone make a gadget for us chemistry students ". I read the post...(&lt;a href="http://blogs.conchango.com/richardgriffin/archive/2007/03/20/Converting-Dashboard-Widgets-to-Sidebar-Gadgets.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.conchango.com/aggbug.aspx?PostID=6368" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=CSXb9_YYnTM:wwbsu2tpm3Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:wF9xT3WuBAs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=CSXb9_YYnTM:wwbsu2tpm3Y:wF9xT3WuBAs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:JEwB19i1-c4"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=CSXb9_YYnTM:wwbsu2tpm3Y:JEwB19i1-c4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?i=CSXb9_YYnTM:wwbsu2tpm3Y:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?a=CSXb9_YYnTM:wwbsu2tpm3Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/conchango/RichardGriffin?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><enclosure url="http://blogs.conchango.com/richardgriffin/attachment/6368.ashx" length="67172" type="application/x-zip-compressed" /><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Musings/default.aspx">Musings</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/.net/default.aspx">.net</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Windows+Vista+Sidebar+Gadget/default.aspx">Windows Vista Sidebar Gadget</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.conchango.com/richardgriffin/archive/tags/Silverlight/default.aspx">Silverlight</category><feedburner:origLink>http://blogs.conchango.com/richardgriffin/archive/2007/03/20/Converting-Dashboard-Widgets-to-Sidebar-Gadgets.aspx</feedburner:origLink></item></channel></rss>
