Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to Wolf Schmidt (MSFT)'s posting on the www.silverlight.net forum, the issue has been identified, explained and potentially resolved as designed. According to him, Silverlight 4 will now consider Silverlight 3's quasi-dynamic behaviour with regard to ControlTemplates in a stricter way, which results in an error in Silverlight 4 when the property does not exist for the TargetType of the ControlTemplate. What's important to note is that when the TargetType is not specified on the ControlTemplate it defaults to TargetType="Control".</p> <p>The resolution to the issue is to specify a TargetType for the ControlTemplate such that the properties used in the template binding will resolve.</p> <p>Here's an updated style with the TargetType specified for the ControlTemplate:</p> <pre><code>&lt;Style x:Key="LabelHeader" TargetType="controls:Label"&gt; &lt;Setter Property="Margin" Value="0" /&gt; &lt;Setter Property="Opacity" Value=".6" /&gt; &lt;Setter Property="VerticalAlignment" Value="Stretch" /&gt; &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="controls:Label"&gt; &lt;Border BorderBrush="#CCCCCCCC" BorderThickness=".5" Background="#CCEFEFEF"&gt; &lt;ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="2" Content="{TemplateBinding Content}"/&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>It would however be very usefull to developers if the IDE/intellisense could verify that the property specified in the TemplateBinding actually exists on the defaulted/specified TargetType of the ControlTemplate.</p> <p>Sourced from: - our forum discussions on Silverlight .NET: (not enough reputation to post >1 hyperlink) - my the MS Connect issue: <a href="https://connect.microsoft.com/VisualStudio/feedback/details/561183" rel="noreferrer">https://connect.microsoft.com/VisualStudio/feedback/details/561183</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload