<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Vincent Sibal's Blog : wpf 4.0</title><link>http://blogs.msdn.com/vinsibal/archive/tags/wpf+4.0/default.aspx</link><description>Tags: wpf 4.0</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>The Control Local Values Bug Solution and new WPF 4.0 related APIs</title><link>http://blogs.msdn.com/vinsibal/archive/2009/05/21/the-control-local-values-bug-solution-and-new-wpf-4-0-related-apis.aspx</link><pubDate>Thu, 21 May 2009 17:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9633846</guid><dc:creator>vinsibal</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/vinsibal/comments/9633846.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vinsibal/commentrss.aspx?PostID=9633846</wfw:commentRss><wfw:comment>http://blogs.msdn.com/vinsibal/rsscomments.aspx?PostID=9633846</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Intro 
&lt;P mce_keep="true"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;FONT size=3 face=Calibri&gt;Previously I did a post on the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/vinsibal/archive/2009/03/24/the-control-local-values-bug.aspx" mce_href="http://blogs.msdn.com/vinsibal/archive/2009/03/24/the-control-local-values-bug.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;“Control Local Values bug”&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; and how a subtle bug can be introduced when setting dependency properties of controls to local values.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In WPF 4.0 (dev10), a mechanism was added to the property engine to solve this problem.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here are the new APIs in dev10:&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #4f6228 1pt dashed; BORDER-LEFT: #4f6228 1pt dashed; PADDING-BOTTOM: 5pt; PADDING-LEFT: 5pt; PADDING-RIGHT: 5pt; BACKGROUND: #f6f5f0; MARGIN-LEFT: 0.1in; BORDER-TOP: #4f6228 1pt dashed; MARGIN-RIGHT: 0in; BORDER-RIGHT: #4f6228 1pt dashed; PADDING-TOP: 5pt; mso-border-alt: dash-small-gap #4f6228 .5pt; mso-border-themecolor: accent3; mso-border-themeshade: 128; mso-element: para-border-div"&gt;
&lt;P style="MARGIN: 12pt 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;public&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DependencyObject &lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;{&amp;nbsp;&lt;/SPAN&gt; 
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: green; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// Sets the value of a dependency property without changing its value source.&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; SetCurrentValue(&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt; dp, &lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; value);&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;} &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;public&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;SPAN style="COLOR: blue"&gt;struct&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ValueSource &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;{&amp;nbsp;&lt;/SPAN&gt; 
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;public&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; IsCurrent { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; }&lt;SPAN style="COLOR: #2b91af"&gt; &lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 12pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #2b91af; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}&lt;/SPAN&gt;&lt;SPAN style="mso-no-proof: yes"&gt; &lt;/P&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Basically, when using DependencyObject.SetCurrentValue instead of DependencyObject.SetValue you set its effective value but its ValueSource remains the same.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This is very similar to coercion.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Sample Test App &lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To make it more clear, I wrote a sample test app that shows the BaseValueSource and ValueSource properties when changing a DependencyProperty (DP) via SetCurrentValue. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;I created a custom control with a DP, TitleProperty, where I track its values.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In addition, I setup several scenarios where the TitleProperty is initially set by a particular BaseValueSource.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll go through one scenario here.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;I setup the custom control where the TitleProperty is set from a Style with a binding.&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;DIV style="BORDER-BOTTOM: #4f6228 1pt dashed; BORDER-LEFT: #4f6228 1pt dashed; PADDING-BOTTOM: 5pt; PADDING-LEFT: 5pt; PADDING-RIGHT: 5pt; BACKGROUND: #f6f5f0; MARGIN-LEFT: 0.1in; BORDER-TOP: #4f6228 1pt dashed; MARGIN-RIGHT: 0in; BORDER-RIGHT: #4f6228 1pt dashed; PADDING-TOP: 5pt; mso-border-alt: dash-small-gap #4f6228 .5pt; mso-border-themecolor: accent3; mso-border-themeshade: 128; mso-element: para-border-div"&gt;
&lt;P style="MARGIN: 12pt 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Key&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="StyleBindingCustomControlStyle"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; local&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;CustomControl&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}"&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="Title"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Value&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; RelativeSource&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;={&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;RelativeSource&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Self&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;},&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 9"&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; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Path&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;=WorkingTag,&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 9"&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; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;StringFormat&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;='Set&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; via Style w&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;/&lt;SPAN style="COLOR: blue"&gt; Binding: {&lt;/SPAN&gt;0&lt;SPAN style="COLOR: blue"&gt;}'}" /&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="Template"&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 5"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;ControlTemplate&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; local&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;CustomControl&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}"&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 7"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;TemplateBinding&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 8"&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; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Background&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;TemplateBinding&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Background&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}" /&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 5"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;ControlTemplate&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt; &lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;GroupBox&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; Header&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="Style Binding"&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;local&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;CustomControl&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="CustomControl_Style_Binding"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&lt;SPAN style="mso-tab-count: 8"&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; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: red; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; StyleBindingCustomControlStyle&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;}"/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt; &lt;/P&gt;&lt;/SPAN&gt;
&lt;P style="MARGIN: 0in 0in 12pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: #a31515; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;GroupBox&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: consolas"&gt;&amp;gt; &lt;/P&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Initially it will look like this:&lt;/FONT&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;SHAPETYPE id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SHAPETYPE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;SHAPETYPE stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;STROKE joinstyle="miter"&gt;&lt;/STROKE&gt;&lt;FORMULAS&gt;&lt;F eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/F&gt;&lt;F eqn="sum @0 1 0"&gt;&lt;/F&gt;&lt;F eqn="sum 0 0 @1"&gt;&lt;/F&gt;&lt;F eqn="prod @2 1 2"&gt;&lt;/F&gt;&lt;F eqn="prod @3 21600 pixelWidth"&gt;&lt;/F&gt;&lt;F eqn="prod @3 21600 pixelHeight"&gt;&lt;/F&gt;&lt;F eqn="sum @0 0 1"&gt;&lt;/F&gt;&lt;F eqn="prod @6 1 2"&gt;&lt;/F&gt;&lt;F eqn="prod @7 21600 pixelWidth"&gt;&lt;/F&gt;&lt;F eqn="sum @8 21600 0"&gt;&lt;/F&gt;&lt;F eqn="prod @7 21600 pixelHeight"&gt;&lt;/F&gt;&lt;F eqn="sum @10 21600 0"&gt;&lt;/F&gt;&lt;/FORMULAS&gt;&lt;PATH o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/PATH&gt;&lt;LOCK aspectratio="t" v:ext="edit"&gt;&lt;/LOCK&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SHAPETYPE&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_1_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_1_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=CLV_1 border=0 alt=CLV_1 src="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_1_thumb.jpg" width=422 height=189 mce_src="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_1_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Notice the BaseValueSource is ‘Style’, IsExpression is ‘True’, and IsCurrent is ‘False’ as expected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;After pressing the “Set Current Value” button the values will update accordingly:&lt;/FONT&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;A href="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_2_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_2_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=CLV_2 border=0 alt=CLV_2 src="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_2_thumb.jpg" width=428 height=191 mce_src="http://blogs.msdn.com/blogfiles/vinsibal/WindowsLiveWriter/TheControlLocalValuesBugSol.0relatedAPIs_7368/CLV_2_thumb.jpg"&gt;&lt;/A&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Now the local value has updated to a new string that I set and IsCurrent has updated to ‘True’.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Also notice that BaseValueSource and IsExpression have not changed which is also expected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you press “Clear Local Value” the values will update back to their initial values.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now to bring back the original issue with the control local values bug, if you were to set or clear the local value any previous BaseValueSource would be overwritten and any expression lost.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I have created other scenarios in the sample with different BaseValueSource behavior so you can understand how setting the current value behaves in those scenarios.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Please be sure to check it out below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Usage Recommendation &lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;For a control developer, the general recommendation is to always use DependencyObject.SetCurrentValue over DependencyObject.SetValue in Control code.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You’ll notice that our stock controls in the 4.0 framework have all been updated to use this API instead of setting the properties with local values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;A href="http://blogs.msdn.com/vinsibal/attachment/9633846.ashx" mce_href="http://blogs.msdn.com/vinsibal/attachment/9633846.ashx"&gt;Here&lt;/A&gt; is the sample app which works with &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=75cbcbcd-b0e8-40ea-adae-85714e8984e3&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=75cbcbcd-b0e8-40ea-adae-85714e8984e3&amp;amp;displaylang=en"&gt;&lt;FONT size=3 face=Calibri&gt;VS 2010 beta 1&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9633846" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/vinsibal/attachment/9633846.ashx" length="28660" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/vinsibal/archive/tags/ControlLocalValues/default.aspx">ControlLocalValues</category><category domain="http://blogs.msdn.com/vinsibal/archive/tags/wpf+4.0/default.aspx">wpf 4.0</category></item><item><title>VS 2010 and .NET Framework 4.0 Beta1 are out now!</title><link>http://blogs.msdn.com/vinsibal/archive/2009/05/21/vs-2010-and-net-framework-4-0-beta1-are-out-now.aspx</link><pubDate>Thu, 21 May 2009 17:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9633839</guid><dc:creator>vinsibal</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vinsibal/comments/9633839.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vinsibal/commentrss.aspx?PostID=9633839</wfw:commentRss><wfw:comment>http://blogs.msdn.com/vinsibal/rsscomments.aspx?PostID=9633839</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;As many of you probably already know, &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;&lt;FONT size=3 face=Calibri&gt;dev10 beta1&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; is available for public download.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some of the additions to Beta1 on the WPF Controls side include:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MultiTouch&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;EasingFunctions for animations&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;DataGrid, Calendar, DatePicker, and VisualStateManager in PresentationFramework.dll &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;New APIs to support the control local values bug&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;And tons of bug fixes on the new controls as well as existing control and element services areas&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;I’ll be going over some of these new features in more depth so stay tuned!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9633839" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vinsibal/archive/tags/wpf+4.0/default.aspx">wpf 4.0</category></item><item><title>The Control Local Values Bug!</title><link>http://blogs.msdn.com/vinsibal/archive/2009/03/24/the-control-local-values-bug.aspx</link><pubDate>Tue, 24 Mar 2009 23:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9505118</guid><dc:creator>vinsibal</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vinsibal/comments/9505118.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vinsibal/commentrss.aspx?PostID=9505118</wfw:commentRss><wfw:comment>http://blogs.msdn.com/vinsibal/rsscomments.aspx?PostID=9505118</wfw:comment><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Intro&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;WPF dependency properties&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; are properties that are registered through the WPF property system.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;By registering with the property system, the property will be provided a set of services such as data binding, styling, change notifications, animation, expressions, invalidation, and coercion.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What I will be discussing here is dynamic value resolution and the issue of setting local values in controls.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri&gt;&lt;FONT size=3&gt;Background&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;A dependency property’s value is dependent on multiple providers where there is a level of precedence for each provider.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.basevaluesource.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.basevaluesource.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;BaseValueSource&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; enum captures these providers (with the first being the lowest precedence and last being the highest)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Unknown&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Default&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Inherited&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;ThemeStyle&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;ThemeStyleTrigger&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Style&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;TemplateTrigger&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;StyleTrigger&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;ImplicitStyleReference&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;ParentTemplate&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;PatentTemplateTrigger&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;Local&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In addition to these base value sources, the dependency property can also come from an expression, animation, or coercion (which the internal WPF code represents them as ModifiedValues).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note that ModifiedValues are mutually exclusive from BaseValueSource.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example you can have a value that is set locally and coerced at the same time. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;So how does this relate to the control local values bug?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;As a control author, dependency properties are the general mechanism to communicate the state and behavior of the control.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;They will be used in data binding scenarios, visual representation, interaction, etc.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This means that you will possibly and most likely be setting values on your dependency properties internally as state changes about your control.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;So as you are setting new values to a dependency property that you own, you may not realize that you are introducing a very subtle bug relating to dynamic value resolution precedence.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’ll use an example to clarify. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The DatePicker control from WPFToolkit has a DP called IsDropDownOpen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is used by the DatePicker control to update when the calendar popup opens and closes.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It listens for a change event and sets the Popup.IsOpen accordingly.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #4f6228 1pt dashed; BORDER-LEFT: #4f6228 1pt dashed; PADDING-BOTTOM: 5pt; PADDING-LEFT: 5pt; PADDING-RIGHT: 5pt; BACKGROUND: #f6f5f0; MARGIN-LEFT: 0.1in; BORDER-TOP: #4f6228 1pt dashed; MARGIN-RIGHT: 0in; BORDER-RIGHT: #4f6228 1pt dashed; PADDING-TOP: 5pt; mso-border-alt: dash-small-gap #4F6228 .5pt; mso-border-themecolor: accent3; mso-border-themeshade: 128; mso-element: para-border-div"&gt;
&lt;P style="MARGIN: 12pt 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; OnIsDropDownOpenChanged(&lt;SPAN style="COLOR: #2b91af"&gt;DependencyObject&lt;/SPAN&gt; d, &lt;SPAN style="COLOR: #2b91af"&gt;DependencyPropertyChangedEventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;DatePicker&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; dp = d &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;DatePicker&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;Debug&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;.Assert(dp != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;bool&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; newValue = (&lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt;)e.NewValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; (dp._popUp != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt; &amp;amp;&amp;amp; dp._popUp.IsOpen != newValue)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;dp._popUp.IsOpen = newValue;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 12pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The Popup also listens for when it opens and closes and makes sure IsDropDownOpen is toggled to the correct state.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #4f6228 1pt dashed; BORDER-LEFT: #4f6228 1pt dashed; PADDING-BOTTOM: 5pt; PADDING-LEFT: 5pt; PADDING-RIGHT: 5pt; BACKGROUND: #f6f5f0; MARGIN-LEFT: 0.1in; BORDER-TOP: #4f6228 1pt dashed; MARGIN-RIGHT: 0in; BORDER-RIGHT: #4f6228 1pt dashed; PADDING-TOP: 5pt; mso-border-alt: dash-small-gap #4F6228 .5pt; mso-border-themecolor: accent3; mso-border-themeshade: 128; mso-element: para-border-div"&gt;
&lt;P style="MARGIN: 12pt 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; PopUp_Opened(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; (!&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.IsDropDownOpen)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;.IsDropDownOpen = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 12pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Notice the bug?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The bug lies in PopUp_Opened when setting IsDropDownOpen to a local value.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This really appears harmless and you probably won’t actually see the bug in action until you hand it over to the app developer who will actually set different value providers on your control DPs.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The problem is that setting a DP locally as an internal operation in your control will trump any and all value providers set on that DP (as local is the highest precedence).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;That means that the app developer who uses your control and decides to put some fancy styles, binding, triggers, and all that goodness will find that it will stop working for some reason and not immediately know what caused it. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;To further describe how this can occur, here is an example using that same DatePicker (note that this has already been fixed in later version of the toolkit).&lt;/FONT&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV style="BORDER-BOTTOM: #4f6228 1pt dashed; BORDER-LEFT: #4f6228 1pt dashed; PADDING-BOTTOM: 5pt; PADDING-LEFT: 5pt; PADDING-RIGHT: 5pt; BACKGROUND: #f6f5f0; MARGIN-LEFT: 0.1in; BORDER-TOP: #4f6228 1pt dashed; MARGIN-RIGHT: 0in; BORDER-RIGHT: #4f6228 1pt dashed; PADDING-TOP: 5pt; mso-border-alt: dash-small-gap #4F6228 .5pt; mso-border-themecolor: accent3; mso-border-themeshade: 128; mso-element: para-border-div"&gt;
&lt;P style="MARGIN: 12pt 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Window.Resources&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Key&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="DatePickerStyle"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;x&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; toolkit&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;DatePicker&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="IsDropDownOpen"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; ElementName&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;=cb_IsDropDownOpen,&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Path&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;=IsChecked}" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Window.Resources&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Grid.RowDefinitions&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;RowDefinition&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="Auto"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;RowDefinition&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="*"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Grid.RowDefinitions&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;CheckBox&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="IsDropDownOpen"&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Name&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="cb_IsDropDownOpen" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;toolkit&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;DatePicker&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; Grid.Row&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="1"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 9"&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; &lt;/SPAN&gt;Name&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="datePicker"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-tab-count: 9"&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; &lt;/SPAN&gt;Style&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; DatePickerStyle&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;}" /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 12pt; BACKGROUND: #f6f5f0; mso-add-space: auto" class=codesampleCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 125%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;I’ve setup a style on the DatePicker where I’ve bound a CheckBox.IsChecked DP to the DatePicker.IsDropDownOpen DP.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you click on the CheckBox, the popup opens as expected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you take a look at the BaseValueSource on IsDropDownOpen it will read Style.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, as soon as you close the popup, the binding does not work anymore which is expected since a local value is set on IsDropDownOpen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Summary&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;To make it really short and sweet, setting dependency properties to local values in internal operations of a control can lead to the dreaded control local values bug.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I’m sure you’re next question is, how can this be prevented?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Well, I will be doing a follow-up post on what has been added in dev10 to easily prevent this bug so stay tuned!&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt;: Check out the follow up post &lt;A href="http://blogs.msdn.com/vinsibal/archive/2009/05/21/the-control-local-values-bug-solution-and-new-wpf-4-0-related-apis.aspx" mce_href="http://blogs.msdn.com/vinsibal/archive/2009/05/21/the-control-local-values-bug-solution-and-new-wpf-4-0-related-apis.aspx"&gt;here&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9505118" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vinsibal/archive/tags/ControlLocalValues/default.aspx">ControlLocalValues</category><category domain="http://blogs.msdn.com/vinsibal/archive/tags/wpf+4.0/default.aspx">wpf 4.0</category></item></channel></rss>