<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Nuno Filipe Godinho : WPF</title><link>http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx</link><description>Tags: WPF</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>New Features in CTP2 ADO.NET Data Services v1.5 Explained</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/09/02/new-features-in-ctp2-ado-net-data-services-v1-5-explained.aspx</link><pubDate>Wed, 02 Sep 2009 19:21:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1720315</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1720315</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1720315</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2009/09/02/new-features-in-ctp2-ado-net-data-services-v1-5-explained.aspx#comments</comments><description>&lt;p&gt;After yesterdays &lt;a href="http://msmvps.com/blogs/nunogodinho/archive/2009/09/01/new-version-ctp-of-ado-net-data-services-v1-5-is-now-available.aspx" target="_blank"&gt;post about the availability of the CTP2 of ADO.NET Data Services v1.5&lt;/a&gt; here are some more details regarding the Projections, Feed Customization and Data Binding.&lt;/p&gt;  &lt;p&gt;As told before &lt;strong&gt;Projections, &lt;/strong&gt;the possibility of getting only the columns chosen instead of retrieving all the columns. With this we have now a new set of expressions to provide this ability on the URI, and in order to achieve we have now two new keywords available, that are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;$select, &lt;/em&gt;allow us to define which columns we want to be get       &lt;ul&gt;       &lt;li&gt;Instead of using only the &lt;a href="http://127.0.0.1/NorthwindService.svc/Customers"&gt;http://127.0.0.1/NorthwindService.svc/Customers&lt;/a&gt; that will return every column of the Entity Customer, we want to define that we only get the CustomerID and the ContactName, and in order to achieve this we use the new $select keyword like this &lt;a href="http://127.0.0.1/NorthwindService.svc/Customers?$select=CustomerID,ContactName"&gt;http://127.0.0.1/NorthwindService.svc/Customers?$select=CustomerID,ContactName&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;The way to define the several columns is to use commas to separate the column names. &lt;/li&gt;        &lt;li&gt;If we want to use this keyword and define all columns is the following &lt;a href="http://127.0.0.1/NorthwindService.svc/Customers?$select"&gt;http://127.0.0.1/NorthwindService.svc/Customers?$select&lt;/a&gt;=* &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;em&gt;$expand, &lt;/em&gt;defines that along with the results from the requested entity, we also want to get the results from a specific relationship       &lt;ul&gt;       &lt;li&gt;Usage: &lt;a href="http://127.0.0.1/NorthwindService.svc/Customers?$expand=Orders/OrderDetails"&gt;http://127.0.0.1/NorthwindService.svc/Customers?$expand=Orders/OrderDetails&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;But in order for this to work we need to add the following 2 properties to the service:      &lt;ul&gt;       &lt;li&gt;First, make projections available using the URI.          &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:449px;padding-right:5px;height:52px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: config.DataServiceBehavior.AcceptProjectionRequests = &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;/pre&gt;
      &lt;/li&gt;

      &lt;li&gt;Secondly, make the protocol version to V2 
        &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:451px;padding-right:5px;height:52px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: config.DataServiceBehavior.MaxProtocolVersion = System.Data.Services.Common.DataServiceProtocolVersion.V2;&lt;/pre&gt;&lt;/pre&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For more information’s regarding this subject read this &lt;a title="http://blogs.msdn.com/astoriateam/archive/2009/09/01/ado-net-data-services-v1-5-ctp2-projections-overview-server.aspx" href="http://blogs.msdn.com/astoriateam/archive/2009/09/01/ado-net-data-services-v1-5-ctp2-projections-overview-server.aspx"&gt;post&lt;/a&gt; from the Product Team. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feed Customizations&lt;/strong&gt; are the possibility to customize the way the feed is created instead of using only the default AtomPub version.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;In order to achieve this customization we must use the EntityPropertyMappingAttribute that will define the relationship between the Property and the name that will be used in the feed. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&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; In the following sample we are defining that when building the feed, instead of using the complete type definition&lt;/p&gt;

&lt;ul&gt;
  &lt;ul&gt;
    &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:451px;padding-right:5px;height:129px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  2:    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;Nuno Godinho&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;name&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  3:    &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;email&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;someone@company.com&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;email&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  4: &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;
  &lt;/ul&gt;
&lt;/ul&gt;

&lt;p&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; we will have the Author element with the value that is on the Name Property of the Author class (considering that Author is a type that contains several properties and one of them is Name):&lt;/p&gt;

&lt;ul&gt;
  &lt;ul&gt;
    &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:453px;padding-right:5px;height:187px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: [EntityPropertyMapping(
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  2:        &amp;quot;&lt;span style="color:#8b0000;"&gt;Author&lt;/span&gt;&amp;quot;,&lt;span style="color:#008000;"&gt;/*Source property path , the property of the Entity type to be mapped*/&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  3:        SyndicationItemProperty.AuthorName,&lt;span style="color:#008000;"&gt;/* Syndication item to which the Source Property is mapped*/&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  4:        SyndicationTextContentKind.Plaintext,&lt;span style="color:#008000;"&gt;/* Syndication content kind for the syndication item this property is bound to */&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  5:        &lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;&lt;span style="color:#008000;"&gt;/* If  false the property value is only placed at the mapped location &amp;amp; removed from the &amp;lt;content&amp;gt; section of the atom:entry*/&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  6:        )]&lt;/pre&gt;&lt;/pre&gt;
and so the result will be: 

    &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:452px;padding-right:5px;height:52px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;Nuno Godinho&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;author&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;
For more information&amp;#39;s regarding this customization read the following posts: 

    &lt;ul&gt;
      &lt;p&gt;&lt;a href="http://blogs.msdn.com/phaniraj/archive/2009/08/31/introducing-web-friendly-feeds-aka-friendly-feeds-updated-for-ctp2.aspx" target="_blank"&gt;Introducing Web Friendly Feeds aka Friendly Feeds (Updated for CTP2)&lt;/a&gt;&lt;/p&gt;

      &lt;p&gt;&lt;a href="http://blogs.msdn.com/phaniraj/archive/2009/03/21/ado-net-data-services-friendly-feeds-mapping-clr-types.aspx" target="_blank"&gt;ADO.NET Data Services Friendly Feeds , Mapping CLR Types&lt;/a&gt;&lt;/p&gt;

      &lt;p&gt;&lt;a href="http://blogs.msdn.com/phaniraj/archive/2009/03/28/ado-net-data-services-friendly-feeds-mapping-edm-types-i.aspx" target="_blank"&gt;ADO.NET Data Services Friendly Feeds , Mapping EDM Types – I&lt;/a&gt;&lt;/p&gt;
    &lt;/ul&gt;
  &lt;/ul&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Binding &lt;/strong&gt;is now simplified, because using the DataServiceCollection class we can bind it directly to the Data Service.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;For more information’s regarding this subject read this &lt;a title="http://blogs.msdn.com/astoriateam/archive/2009/09/01/introduction-to-data-binding-in-ctp2.aspx" href="http://blogs.msdn.com/astoriateam/archive/2009/09/01/introduction-to-data-binding-in-ctp2.aspx"&gt;post&lt;/a&gt; from the Product Team. &lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1720315" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category></item><item><title>TemplateBinding inside ControlTemplate.Triggers</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/09/01/templatebinding-inside-controltemplate-triggers.aspx</link><pubDate>Tue, 01 Sep 2009 19:03:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1719937</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1719937</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1719937</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2009/09/01/templatebinding-inside-controltemplate-triggers.aspx#comments</comments><description>&lt;p&gt;One of the limitations of TemplateBinding Markup in WPF is the fact that we cannot use it inside the ControlTemplate.Triggers because it really doesn’t work, since as Mike Hillberg said &lt;a href="http://social.msdn.microsoft.com/forums/en-US/wpf/thread/1de3470a-1a50-4e2f-aa38-2a9a3507084a/" target="_blank"&gt;here&lt;/a&gt;, &lt;em&gt;“TemplateBinding is a lightweight, but less functional, version of a Binding with a RelativeSource of TemplatedParent.&amp;#160; One of the things that a TemplateBinding can&amp;#39;t do is work within the ControlTemplate.Triggers; TemplateBinding only works within the template content”&lt;/em&gt; .&lt;/p&gt;  &lt;p&gt;So we have this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MyControl.cs&lt;/p&gt;  &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:500px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: 	&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MyControl : Control
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  2: 	{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  3: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  4: 		&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Boolean Selected
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  5: 		{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  6: 			&lt;span style="color:#0000ff;"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (Boolean)GetValue(SelectedProperty); }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  7: 			&lt;span style="color:#0000ff;"&gt;set&lt;/span&gt; { SetValue(SelectedProperty, &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;); }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  8: 		}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  9: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 10: 		&lt;span style="color:#008000;"&gt;// Using a DependencyProperty as the backing store for Selected.  This enables animation, styling, binding, etc...&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 11: 		&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;readonly&lt;/span&gt; DependencyProperty SelectedProperty =
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 12: 			DependencyProperty.Register(&amp;quot;&lt;span style="color:#8b0000;"&gt;Selected&lt;/span&gt;&amp;quot;, &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(Boolean), &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(MyControl), &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; UIPropertyMetadata(&lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;));
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 13: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 14: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 15: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 16: 		&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Brush SelectedColor
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 17: 		{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 18: 			&lt;span style="color:#0000ff;"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; (Brush)GetValue(SelectedColorProperty); }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 19: 			&lt;span style="color:#0000ff;"&gt;set&lt;/span&gt; { SetValue(SelectedColorProperty, &lt;span style="color:#0000ff;"&gt;value&lt;/span&gt;); }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 20: 		}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 21: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 22: 		&lt;span style="color:#008000;"&gt;// Using a DependencyProperty as the backing store for SelectedColor.  This enables animation, styling, binding, etc...&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 23: 		&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;readonly&lt;/span&gt; DependencyProperty SelectedColorProperty =
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 24: 			DependencyProperty.Register(&amp;quot;&lt;span style="color:#8b0000;"&gt;SelectedColor&lt;/span&gt;&amp;quot;, &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(Brush), &lt;span style="color:#0000ff;"&gt;typeof&lt;/span&gt;(MyControl), &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; UIPropertyMetadata(Brushes.Red));
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 25: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 26: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 27: 		&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MyControl()
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 28: 		{			
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 29: 		}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 30: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 31: 		&lt;span style="color:#0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;override&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; OnInitialized(EventArgs e)
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 32: 		{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 33: 			&lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;.OnInitialized(e);
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 34: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 35: 			&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.MouseLeftButtonDown += &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; System.Windows.Input.MouseButtonEventHandler(MyControl_MouseLeftButtonDown);
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 36: 		}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 37: 
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 38: 		&lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; MyControl_MouseLeftButtonDown(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, System.Windows.Input.MouseButtonEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 39: 		{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 40: 			MessageBox.Show(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.SelectedColor.ToString());
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 41: 			&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Selected = !&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Selected;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 42: 		}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 43: 	}
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 44: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Window1.xaml&lt;/strong&gt;&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:500px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Class&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;WpfApplication13.Window1&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  2:     &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  3:     &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  4: 	&lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;local&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;clr-namespace:WpfApplication13&amp;quot;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  5:     &lt;span style="color:#ff0000;"&gt;Title&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Window1&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Height&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;300&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Width&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;300&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  6:     &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  7: 		&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;local&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MyControl&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;ctrl1&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  8: 			&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c71585;"&gt;local&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MyControl.Template&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  9: 				&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetType&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{x:Type local:MyControl}&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 10: 					&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Background&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Green&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x&lt;/span&gt;:&lt;span style="color:#ff0000;"&gt;Name&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;source&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 11: 					&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate.Triggers&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 12: 						&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Trigger&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Selected&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 13: 							&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetName&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;source&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Background&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{TemplateBinding SelectedColor}&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 14: 						&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Trigger&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 15: 						&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Trigger&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Selected&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 16: 							&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetName&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;source&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Background&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Green&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 17: 						&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Trigger&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 18: 					&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate.Triggers&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 19: 				&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 20: 			&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c71585;"&gt;local&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MyControl.Template&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 21: 		&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c71585;"&gt;local&lt;/span&gt;:&lt;span style="color:#800000;"&gt;MyControl&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 22: 	&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 23: &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Window&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt; 24: &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;When we compile we get the following error, &lt;em&gt;&amp;quot;Cannot convert the value in attribute &amp;#39;Value&amp;#39; to object of type &amp;#39;&amp;#39;.&amp;#160; Error at object &amp;#39;System.Windows.Setter&amp;#39; in markup file &amp;#39;WpfApplication13;component/window1.xaml&amp;#39; Line 13 Position 58.&amp;quot;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So how can we solve this problem?&lt;/p&gt;

&lt;p&gt;&amp;#160;&amp;#160; Since the problem here is that &lt;em&gt;TemplateBinding&lt;/em&gt; is not supported inside the ControlTemplate.Triggers, we have to find another way to make the binding, and so we just change the line 13 to&lt;/p&gt;

&lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:500px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:12px;"&gt;  1: 							&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Setter&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;TargetName&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;source&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Property&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;Background&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Value&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;&amp;quot;{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedColor}&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; And if we look at the &lt;a href="http://msdn.microsoft.com/en-us/library/ms742882.aspx" target="_blank"&gt;TemplateBinding Markup&lt;/a&gt; page in MSDN, the usage of TemplateBinding is similar to the &lt;a href="http://msdn.microsoft.com/en-us/library/ms750413.aspx" target="_blank"&gt;Binding Markup&lt;/a&gt; using TemplatedPart as the RelativeSource, like {Binding RelativeSource={RelativeSource TemplatedParent}, Path=&lt;em&gt;DependencyPropertyToBind&lt;/em&gt;}&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1719937" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/.NET+3.5+SP1/default.aspx">.NET 3.5 SP1</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/UX/default.aspx">UX</category></item><item><title>Interesting Diagram Generation Controls</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/08/06/interesting-diagram-generation-controls.aspx</link><pubDate>Thu, 06 Aug 2009 17:14:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1713869</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1713869</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1713869</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2009/08/06/interesting-diagram-generation-controls.aspx#comments</comments><description>&lt;p&gt;Some time from now I was searching for controls that would made the generation of diagrams of several kinds, like for instance::&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Network Diagram &lt;/li&gt;    &lt;li&gt;Worlflow Diagram &lt;/li&gt;    &lt;li&gt;Database Diagram &lt;/li&gt;    &lt;li&gt;Hierarchy Diagram &lt;/li&gt;    &lt;li&gt;… &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160; Basically I was trying to find a control that would solve the problem of having to search for different controls depending on the type of diagrams I would need in my projects, an in this case the project was in Silverlight. After a lot of research and a lot of CodeProject and others that would just fit a specific problem, I came across one that solved exactly what I was needing, and I found it on &lt;a href="http://www.mindfusion.eu/" target="_blank"&gt;MindFusion&lt;/a&gt; named &lt;a href="http://www.mindfusion.eu/diagramlite.html" target="_blank"&gt;DiagramLite&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160; The DiagramLite is a quite interesting control since it provides a way for us to make available any kind of diagram in Silverlight and with the possibility of editing that diagram, and this makes it possible to create a new Workflow designer for our solutions using Silverlight. (Of course I now that this was done without this control, but it seems to me that it would be a lot easier with it, but this is just from my experience).&lt;/p&gt;  &lt;p&gt;&amp;#160; You can find &lt;a href="http://mindfusion.eu/demos/diagramlite/index.html" target="_blank"&gt;samples here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160; Along with the Silverlight version I also found that they also have several other versions for WPF, WinForms, ASP.NET, .Net Compact Framework and even Java, and for this it seems that they are pretty experts into the Diagram controls, and it’s pretty interesting since their support is pretty quick as well as clear.&lt;/p&gt;  &lt;p&gt;&amp;#160; I hope this post comes handy for you, since when it was me I had to to do a lot of searching and testing for several possibilities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1713869" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category></item><item><title>WPF Charting is already available in WPF Toolkit of June 2009</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/07/06/wpf-charting-is-already-available-in-wpf-toolkit-of-june-2009.aspx</link><pubDate>Mon, 06 Jul 2009 21:57:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1698498</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1698498</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1698498</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2009/07/06/wpf-charting-is-already-available-in-wpf-toolkit-of-june-2009.aspx#comments</comments><description>&lt;p&gt;The long wait has finished as the WPF Charting was made available on the last WPF Toolkit release of June 2009 and now we can use all those great charts that were available for Silverlight, now also in WPF.&lt;/p&gt;  &lt;p&gt;You can know more about this &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1698498" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/UX/default.aspx">UX</category></item><item><title>MIX’09 – Reviewing – Future of Expression Blend</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/06/08/mix-09-reviewing-future-of-expression-blend.aspx</link><pubDate>Mon, 08 Jun 2009 13:14:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1694547</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1694547</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1694547</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2009/06/08/mix-09-reviewing-future-of-expression-blend.aspx#comments</comments><description>&lt;p&gt;Douglas Olson – General Manager&lt;/p&gt;  &lt;p&gt;Christian Schormann – Director, Program Manager&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Expression Mission&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Enable professional designers to create great &lt;em&gt;UX&lt;/em&gt; with &lt;em&gt;better productivity &lt;/em&gt;at &lt;em&gt;lower costs.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Help integrate design and designers into the process of software creation &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Expression Blend 3 Goals&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Enable early-stage design &amp;amp; prototyping (SketchFlow)      &lt;ul&gt;       &lt;li&gt;Created to address issues felt at the start of the software design process:          &lt;ul&gt;           &lt;li&gt;Top-down &amp;amp; bottom-ups design lets you experiments with ideas &lt;/li&gt;            &lt;li&gt;SketchFlow Player lets you try your design at any time &lt;/li&gt;            &lt;li&gt;Facilitate communication of design ideas &lt;/li&gt;            &lt;li&gt;Easy to gather, evaluate and use stakeholders feedback &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Blend Elements          &lt;ul&gt;           &lt;li&gt;SketchFlow Application Flow              &lt;ul&gt;               &lt;li&gt;Important to think on pages like whiteboards to sketch, insert elements, and all what you normally do. &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Usage of SketchStyles that will allow us to maintain the Sketchy style of the Design proposal, that is very important. &lt;/li&gt;        &lt;li&gt;Export to Word          &lt;ul&gt;           &lt;li&gt;Dumps all the SketckFlow elements like Application Flow, Pages, Comments and so on. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Make visual design easier for designer      &lt;ul&gt;       &lt;li&gt;Embrace the Design Ecosystem          &lt;ul&gt;           &lt;li&gt;Adobe Photoshop &amp;amp; Illustrator file format import with extensive support for layers              &lt;ul&gt;               &lt;li&gt;Preview of Photoshop in Windows Explorer even without PhotoShop installed &lt;/li&gt;                &lt;li&gt;Possibility to choose what to do with each layer &lt;/li&gt;                &lt;li&gt;Blend informs if the font is default or not and gives the possibility to choose other font or even the same font by specifying the path of the font &lt;/li&gt;                &lt;li&gt;All content will be fully editable &lt;/li&gt;                &lt;li&gt;Layer Groups are also maintained &lt;/li&gt;                &lt;li&gt;By selecting an object we can make “Make into Control”                  &lt;ul&gt;                   &lt;li&gt;We choose the type of control we want to create &lt;/li&gt;                    &lt;li&gt;What’s done is:                      &lt;ul&gt;                       &lt;li&gt;A style is created in order for the control to became what was defined when we selected the elements to generate the control. &lt;/li&gt;                        &lt;li&gt;The control created will replace the selected element and gain the same properties that the original element had. &lt;/li&gt;                        &lt;li&gt;The style is associates to the control &lt;/li&gt;                        &lt;li&gt;&lt;strong&gt;Note: &lt;/strong&gt;There’s now a problem when the controls have different parts, like the Slider, and this will generate all but we need to wire-up the style to the correct parts &lt;/li&gt;                     &lt;/ul&gt;                   &lt;/li&gt;                 &lt;/ul&gt;               &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;Fast and Easy Control Skinning &lt;/li&gt;            &lt;li&gt;Enhanced editing of visual States &lt;/li&gt;            &lt;li&gt;Richer state transitions &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Focus On Your Art          &lt;ul&gt;           &lt;li&gt;Redefined artboard interaction &lt;/li&gt;            &lt;li&gt;Better gradient editing &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Design with Data (Data Generation / Sampling inside Blend)      &lt;ul&gt;       &lt;li&gt;In the Data Tab we will have the possibility to define the DataSource structure that we want, and then just generate the data, and there are some templates like Phone Numbers, Strings, Dates, and so on. &lt;/li&gt;        &lt;li&gt;Make it easy to build a data-driven applications:          &lt;ul&gt;           &lt;li&gt;Sample Data:              &lt;ul&gt;               &lt;li&gt;Design applications without access to live data source &lt;/li&gt;                &lt;li&gt;Create sample data on the fly &lt;/li&gt;                &lt;li&gt;Populate with configurable random data &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;Drag and Drop Master-Detail creation &lt;/li&gt;            &lt;li&gt;Better user experience for data binding &lt;/li&gt;            &lt;li&gt;Design-time support for Silverlight 3 controls &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;There’s a Master and a Details Mode in the Data Tab that will make it easier to perform the Master-Details view          &lt;ul&gt;           &lt;li&gt;in this version of Blend we need to wire-up the Master and Detail elements, and this will not be needed in the last version of Blend &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Build interactivity without code (Behaviors)      &lt;ul&gt;       &lt;li&gt;Introduction to Behaviors:          &lt;ul&gt;           &lt;li&gt;Production-quality interactivity applied with Drag &amp;amp; Drop ease &lt;/li&gt;            &lt;li&gt;A design pattern for reusable interactivity &lt;/li&gt;            &lt;li&gt;Example: MouseGestureBehavior              &lt;ul&gt;               &lt;li&gt;You can define the gesture that will be used and make changes to the elements based on that gesture &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Enable Source Code Control (Integration with Source Safe and TFS by default) – This is available also inside Expression Web      &lt;ul&gt;       &lt;li&gt;Design for Developers          &lt;ul&gt;           &lt;li&gt;Source Control              &lt;ul&gt;               &lt;li&gt;Visual Studio Team Foundation Server Support &lt;/li&gt;                &lt;li&gt;New editor with Intellisense for code &amp;amp; XAML &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Support for Silverlight 3 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;The same features are available for WPF and Silverlight in Blend 3.&lt;/p&gt;    &lt;p&gt;It’s important to avoid having final or high-definition elements in the Sketch design because customers will start looking in the direction of the rendering instead of the functionality.&lt;/p&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1694547" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/SketchFlow/default.aspx">SketchFlow</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/MIX09/default.aspx">MIX09</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/UX/default.aspx">UX</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Blend/default.aspx">Blend</category></item><item><title>First Code Parts of Prism 2.0</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/09/26/first-code-parts-of-prism-2-0.aspx</link><pubDate>Fri, 26 Sep 2008 18:07:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648992</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1648992</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1648992</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/09/26/first-code-parts-of-prism-2-0.aspx#comments</comments><description>&lt;p&gt;&amp;#160; As I &lt;a href="http://weblogs.asp.net/nunogodinho/archive/2008/09/04/pirsm-2-0-what-can-we-expect.aspx" target="_blank"&gt;previously posted&lt;/a&gt;, Prism 2.0 is shaping up and some of the new Code Parts are already available on &lt;a href="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=17399" target="_blank"&gt;CodePlex&lt;/a&gt;. Of course this is only a small part but it brings good news like:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Multi-targeting quick starts, that explains the structure that a Prism 2.0 project will have in order to be Multi-target for WPF and Silverlight, and in this case is a real state solution. &lt;/li&gt;    &lt;li&gt;Multi-targeting Visual Studio Templates, in order to be possible to create the Prism 2.0 projects. &lt;/li&gt;    &lt;li&gt;Project Linker Tool, that provides a guidance on how to structure an application in a way that is possible to link it to other applications in order to make it Multi-targeted. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Read more about it in the &lt;a href="http://www.codeplex.com/CompositeWPF/Wiki/View.aspx?title=Prism%20V2%20Drop%201%20Readme" target="_blank"&gt;Readme file&lt;/a&gt; that defines this first drop, and also &lt;a href="http://blogs.msdn.com/dphill/" target="_blank"&gt;David Hill&lt;/a&gt;’s &lt;a href="http://blogs.msdn.com/dphill/archive/2008/09/19/prism-2-0-first-drop.aspx" target="_blank"&gt;blog post&lt;/a&gt; about this subject. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648992" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Patterns/default.aspx">Patterns</category></item><item><title>Silverlight Applications Offline</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/09/01/silverlight-applications-offline.aspx</link><pubDate>Mon, 01 Sep 2008 18:45:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1646412</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1646412</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1646412</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/09/01/silverlight-applications-offline.aspx#comments</comments><description>&lt;p&gt;&amp;#160; This has always been an issue when we talk about Silverlight and so much as been said about it, and so let’s look at the options.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; First of all we need to think that Silverlight was not built to be a technology to deliver Occasionally Online applications, it was built to deliver RIA, and so it was made to use Online and not Offline. &lt;strong&gt;Is this a problem?&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160; Secondly, Silverlight is a subset of Windows Presentation Foundation (WPF),&lt;em&gt; &lt;/em&gt;and so my question is: &lt;strong&gt;Do we really need the Occasionally Online approach in Silverlight or do we need to be able to run everything we do in Silverlight in WPF also?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160; And so my thoughts about my own questions are: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; There’s no problem with Silverlight not having been thought in terms of needing the Occasionally Online approach because this is the purpose of WPF, but it must be enhanced with something like the Occasionally Offline approach, because sometimes our Internet connections go down, for several different reasons, and we don’t want to lose all our work done in the Silverlight apps. And if we think that Silverlight 2.0 was built to bring the ability not only for the islands of richness, that was brought by the version 1.0, but also to provide a platform to build Line-Of-Business Applications this will take a lot more importance. &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Still about Silverlight having the need to support the Occasionally Online approach I would say that this isn’t really a must have because this is really an Architectural choice to be made during the product planing, and so if we need a Occasionally Online approach we use WPF, and if we need an Online approach we’ll use Silverlight.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; OK this is nice but there’s one important aspect that we are forgetting and that is that a product will evolve and suddenly it can turn to need an Occasionally Online approach and so, &lt;strong&gt;what will we do?&lt;/strong&gt; &lt;strong&gt;Will we need to build the application again?&lt;/strong&gt; Of course not, this is where the interaction between WPF and Silverlight needs to appear, because it’s needed that all the features and even controls that work in Silverlight work well in WPF, because this is how real subset frameworks work, and is this now true in Silvelight and WPF? The answer is not everything works, but it’s being worked on.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160; So a lot still needs to be done in this two awesome technologies that bring great User Experience for applications, but we need to think also that they are relatively new because WPF with the release of .NET 3.5 SP1 just had it’s &lt;strong&gt;Third Major Release&lt;/strong&gt;, and Silvelight is only going for it’s &lt;strong&gt;Second&lt;/strong&gt;. This being said a lot should be expected in both this areas.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; In terms of what choices do we have today for making Silvelight a Desktop application / Occasionally Online Applications, they are the following:&lt;/p&gt;  &lt;ol&gt;   &lt;ol&gt;     &lt;ol&gt;       &lt;li&gt;Pack it with a lightweight Web Server like Cassini Web Server&lt;/li&gt;        &lt;li&gt;Pack it with a custom build Windows Service that will serve the Http Requests needed by the Silverlight App. This seams to me a lot harder because to much as to be done.&lt;/li&gt;        &lt;li&gt;Transform it to a WPF like Application. Use this &lt;a href="http://blendables.com/labs/Desklighter/Default.aspx" target="_blank"&gt;Desklighter tool&lt;/a&gt; that will convert your Silverlight App into a Desktop App.&lt;/li&gt;     &lt;/ol&gt;   &lt;/ol&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&amp;#160; &lt;strong&gt;This is a very interesting topic and I would like to ear your thoughts about this subject, so feel free to comment.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646412" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Windows Presentation Foundation Major Release 3</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/08/27/windows-presentation-foundation-major-release-3.aspx</link><pubDate>Wed, 27 Aug 2008 21:08:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1646017</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1646017</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1646017</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/08/27/windows-presentation-foundation-major-release-3.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&amp;#160; With the release of the .NET Framework 3.5 SP1 the WPF suffered the third major release of it’s short history.&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; This major areas that were affected were:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Deployment &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Now instead of needing the full framework installation it was made a lightweight version in order to run only this technology, and&amp;#160; this is called the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=8CEA6CD1-15BC-4664-B27D-8CEBA808B28B&amp;amp;displaylang=en" target="_blank"&gt;Client Profile&lt;/a&gt;. This lightweight version that consumes 25 MB includes the following:&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;CLR (bases of the .NET Framework) &lt;/li&gt;      &lt;li&gt;Click Once (Used in the installation of the WPF applications) &lt;/li&gt;      &lt;li&gt;Windows Forms (Runtime used to run the Windows Forms solutions that can be held also inside WPF applications using WindowsFormsHost class) &lt;/li&gt;      &lt;li&gt;Windows Presentation Foundation (Runtime used to run the WPF solutions that can also be held inside Windows Forms Applications using the ElementHost class) &lt;/li&gt;      &lt;li&gt;Windows Communication Foundation (Runtime used to run and consume WCF services that are normally used by Windows and WPF applications) &lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Graphics &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; This versions includes powerful enhancements on the WPF graphics primarily on the 3D scope in controls like UIElement3D and Viewport2DVisual3D (that is responsible for making 2D object viewable in 3D).&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Also brings the &lt;a href="http://msdn.microsoft.com/en-us/library/bb944006%28VS.85%29.aspx#Pixel_Shader_Basics" target="_blank"&gt;HLSL shaders&lt;/a&gt; with the ShaderEffect class, that are entirely implemented on the GPU level, which makes it a lot faster, in case you have the Pixel Shader 2.0 support on your hardware).&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Another class that was also enhanced was the WritableBitmap class that now enables a very efficient image manipulation, by giving the ability to provide bitmap images mapped in the system memory that will give us the ability to change it on runtime and have the effects immediately on the screen.&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Performance &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Changes to the cold start on the application that are now improved in 45% depending on the application size.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Virtualization optimizations such as in TreeView, columns that can now be virtualized and that will enable a better and easier creation of DataGrid controls.&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;New Controls &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; The much asked Datagrid control is now part of the WPF controls that are made available, but that will be released after the .net 3.5 SP1 release.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; The Office Ribbon control is also part of the new WPF controls and will also be released after the .net 3.5 SP1 release as the DataGrid Control.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; A Rich functionality WebBrowser Control, that in the previous versions worked via a Frame Element, and now will permit javacript and other funcionalities that exist on the normal browsers, and also will provide the ability for WPF applications to host Silverlight contents.&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Other Enhancements &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Support for String formatting on the databinding of text without having to implement the IValueConverter interface.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Extended support for the XBAP for the Firefox by providing the ClickOnce native support inside it.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Improvements in the WPF Designer of the Visual Studio 2008 solving some problems that existed with the rendering of elements majorly when they were based on other custom controls.&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; There’s a change that needs to be made on the Blend 2.5 Preview in order to solve some of this problems and that can be &lt;a href="http://www.microsoft.com/expression/try-it/default.aspx?filter=prerelease" target="_blank"&gt;downloaded here&lt;/a&gt;.&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Integration &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Improved DirectX integration by having the D3DImage class that enabled the developer to overlay or blend the Direct3D contents with the WPF contents.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In conclusion, all great stuff for those who develop using this powerful Microsoft Technology called WPF that changed the main community site to the &lt;a href="http://windowsclient.net/wpf" target="_blank"&gt;WindowsClient.net/WPF&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;For more information’s check the following links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/jaimer" target="_blank"&gt;Jaime Rodriguez&lt;/a&gt; blog post on &lt;a href="http://blogs.msdn.com/jaimer/archive/2008/08/15/cheat-sheet-to-some-of-the-wpf-3-5-sp1-features.aspx" target="_blank"&gt;WPF 3.5 SP1 features&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/jgoldb" target="_blank"&gt;WPF perfomance&lt;/a&gt; blog post on &lt;a href="http://blogs.msdn.com/jgoldb/archive/2008/05/15/what-s-new-for-performance-in-wpf-in-net-3-5-sp1.aspx" target="_blank"&gt;What’s New for Performance in WPF in .Net 3.5 SP1&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/tims" target="_blank"&gt;Tim Sneath&lt;/a&gt; blog post on &lt;a href="http://blogs.msdn.com/tims/archive/2008/05/12/introducing-the-third-major-release-of-windows-presentation-foundation.aspx" target="_blank"&gt;Introducing the Third Major Release of Windows Presentation Foundation&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646017" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/.NET+3.5+SP1/default.aspx">.NET 3.5 SP1</category></item><item><title>Composite Application Guidance for WPF (Prism) now goes to Silverlight 2.0</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/08/06/composite-application-guidance-for-wpf-prism-now-goes-to-silverlight-2-0.aspx</link><pubDate>Thu, 07 Aug 2008 00:34:02 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643621</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1643621</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1643621</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/08/06/composite-application-guidance-for-wpf-prism-now-goes-to-silverlight-2-0.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&amp;nbsp; As I said in a previous post &lt;a href="http://msmvps.com/blogs/nunogodinho/archive/2008/07/08/composite-application-guidance-for-wpf.aspx" target="_blank"&gt;Composite Application Guidance for WPF formerly known as &amp;quot;Prism&amp;quot;&lt;/a&gt; was made available and this was a great news because now the development of WPF solutions is easier and as a Guidance that will lead us all the way, helping us make the right choices whenever problems emerge. This is great but being Silverlight a subset of WPF, so wouldn&amp;#39;t be great to have the same kind of guidance for Silverlight 2.0?&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp; This is precisely what the team thought and then they started working on it and now we have some &amp;quot;spike&amp;#39;s&amp;quot; (A ’spike’ is a small and quickly developed sample application in order to mitigate some risks) being released that will do exactly this, as is announced by &lt;a href="http://blogs.southworks.net/ejadib/2008/08/06/silverlight-composite-application-guidance-prism-spike-published/" target="_blank"&gt;Ezequiel Jadib on his blog&lt;/a&gt;. It&amp;#39;s worth to check and I think it will be very interesting in the near future.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643621" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Patterns/default.aspx">Patterns</category></item><item><title>Business Solutions in WPF</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/07/08/business-solutions-in-wpf.aspx</link><pubDate>Tue, 08 Jul 2008 23:04:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1639874</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1639874</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1639874</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/07/08/business-solutions-in-wpf.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Normally Business Solutions tend to have a &amp;quot;grey&amp;quot; design and don&amp;#39;t always have the best User Experience, and in order to show that mission critical solutions can also be developed with a better UX, &lt;a href="http://blogs.msdn.com/brada/default.aspx" target="_blank"&gt;Brad Adams&lt;/a&gt; on his &lt;a href="http://blogs.msdn.com/brada/default.aspx" target="_blank"&gt;blog&lt;/a&gt; made a post about what he thought to be a solution with a good UX and even presented the a WebCast that talks about what and how it was developed. In this case it&amp;#39;s a WPF applications, but a Silverlight versions is on it&amp;#39;s way. See more &lt;a title="aqui" href="http://blogs.msdn.com/brada/archive/2008/07/07/great-user-experience-example-in-a-business-application.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639874" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category></item><item><title>Composite Application Guidance for WPF</title><link>http://msmvps.com/blogs/nunogodinho/archive/2008/07/08/composite-application-guidance-for-wpf.aspx</link><pubDate>Tue, 08 Jul 2008 22:25:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1639867</guid><dc:creator>NunoGodinho</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/rsscomments.aspx?PostID=1639867</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/nunogodinho/commentapi.aspx?PostID=1639867</wfw:comment><comments>http://msmvps.com/blogs/nunogodinho/archive/2008/07/08/composite-application-guidance-for-wpf.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WPF is a very interesting technology since it provides the possibility to have a better User Experience on our Windows Applications, and by doing so it attracted many designers, enthusiasts as well as Developers, Architects and IT Managers, but what happens with new technologies is that sometimes they are misused by developers and became a problem. And so in order to help developers and architects attend to this type of problems the Patterns and Practices Team has been working on a project named &amp;quot;Composite Application Guidance for WPF&amp;quot;, that will make the necessary &lt;em&gt;&amp;quot;mind&amp;quot; &lt;/em&gt;adjustments and bring flexibility to the development of new applications in WPF.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This comes on a road that has been very useful on several other technologies like, &lt;a href="http://msdn.microsoft.com/webclientfactory" target="_blank"&gt;Web Client Software Factory&lt;/a&gt; for ASP.NET, &lt;a href="http://msdn.microsoft.com/en-us/library/aa480450.aspx" target="_blank"&gt;Composite UI Application Block&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/smartclientfactory" target="_blank"&gt;Smart Client Software Factory&lt;/a&gt; for Smart Clients, and even the &lt;a href="http://msdn.microsoft.com/en-us/library/cc512464.aspx" target="_blank"&gt;Enterprise Library&lt;/a&gt;, and by doing this the developer has a kind of guideline making the process of developing solutions a little easier.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; So check this out &lt;a title="here" href="http://msdn.microsoft.com/en-us/library/cc707819.aspx" target="_blank"&gt;here&lt;/a&gt; .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639867" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/WPF/default.aspx">WPF</category><category domain="http://msmvps.com/blogs/nunogodinho/archive/tags/Patterns/default.aspx">Patterns</category></item></channel></rss>