Note that there are some explanatory texts on larger screens.

plurals
  1. POImplicit theme error:The property 'Content' was not found in type 'System.Windows.Controls.Control'
    primarykey
    data
    text
    <p>I have got an error while trying to upgrade our large project to SL4. I didn't write the original theme and my theme knowlege isn't great. In my demo app I have a Label and a LabelHeader(which i have created and is just a derived class from Label with DefaultStyleKey = typeof(LabelHeader);<br> I am styling the LabelHeader like this:</p> <pre><code> &lt;Style TargetType="themeControls:LabelHeader"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate&gt; &lt;DataInput:Label FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" Foreground="{TemplateBinding Foreground}" Content="{TemplateBinding Content}"/&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;Setter Property="FontFamily" Value="Tahoma"/&gt; &lt;Setter Property="FontSize" Value="20"/&gt; &lt;Setter Property="Foreground" Value="Red"/&gt; &lt;/Style&gt; </code></pre> <p>This works in SL3 but in SL4 I get:</p> <p>Error: Unhandled Error in Silverlight Application Code: 2500<br> Category: ParserError<br> Message: The property 'Content' was not found in type 'System.Windows.Controls.Control'.<br> File:<br> Line: 9<br> Position: 168 </p> <p>If I change this: Content="{TemplateBinding Content}" to Content="XXX" Then there is no error but , of course, I get XXX in my label rather than the content I set in XAML on the page</p> <p>Any ideas how I can get this working?</p> <p>Demo project here:</p> <p><a href="http://walkersretreat.co.nz/files/ThemeIssue.zip" rel="noreferrer">http://walkersretreat.co.nz/files/ThemeIssue.zip</a></p> <p>(Apologies for reposting, I have so far got no answers over here: <a href="http://forums.silverlight.net/forums/p/183380/415930.aspx#415930" rel="noreferrer">http://forums.silverlight.net/forums/p/183380/415930.aspx#415930</a>)</p> <p>EDIT The answer provided looks like it will work. An issue has been opened for this issue here: <a href="https://connect.microsoft.com/VisualStudio/feedback/details/561183" rel="noreferrer">https://connect.microsoft.com/VisualStudio/feedback/details/561183</a> </p> <p>vote if you think this is important!</p>
    singulars
    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.
 

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