wpf - What's wrong with this ContentTemplate? -


I am getting an error within a style for this content template: "Specify both property and value for Setter should do." Am I not doing this?

  & lt; Style x: key = "link button" target type = "button" & gt; & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "Button" & gt; & Lt; ContentPresenter / & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; Setter Property = "Content Template" & gt; & Lt; Setter.Value & gt; & Lt; DataTemplate & gt; & Lt; Label x: name = "ContentRoot" & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Viewbox Width = "24" Height = "24" Vertical Element = "Center" & gt; & Lt; Image X: name = "ButtonImage" source = "{binding relativeSource = {RelativeSource mode = FindAncestor, AncestorType = {x: type button}}, path = tag}" /> & Lt; / Viewbox & gt; & Lt; TextBlock VerticalAlignment = "center" X: name = "ButtonText" text = "{binding relativeSource = {RelativeSource mode = FindAncestor, AncestorType = {x: type button}}, path = content}" & gt; & Lt; / TextBlock & gt; & Lt; / StackPanel & gt; & Lt; / Labels & gt; & Lt; DataTemplate.Triggers & gt; & Lt; Trigger Property = "Ismouth Over" Value = "True" & gt; & Lt; Setter target name = "buttontext" property = "text block. Test dictation" value = "underline" /> & Lt; / Catalyst & gt; & Lt; /DataTemplate.Triggers> & Lt; / DataTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt;  

And there is a button that will use this style:

  & lt; Button name = "help button" style = "{static resources link button}" height = "30" content = "help" tag = "help.png" />  

Thanks!

I have loaded it and I do not have such problems I see that the only problem is That your button will never apply style. The reason for this is that if you want the style to apply, then you have to remove from X: the key from style otherwise if you want to apply Style HelpButton, the definition should look like this:

 < Code> & lt; Button name = "HelpButton" style = "{StaticResource LinkButton}" height = "30" content = "help" tag = "help.png" />  

But I can not see the error you are seeing.


Comments