1
我想在我的WPF图表中设计风格的传奇项目。我有以下LegendStyle,但这不会改变任何东西。我究竟做错了什么?WPF图例传奇项目风格
谢谢!
<Style x:Key="LegendStyle1" TargetType="{x:Type datavis:Legend}">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="charting:LegendItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charting:LegendItem">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Rectangle Width="40" Height="40" Fill="{Binding Background}" Stroke="{Binding BorderBrush}" StrokeThickness="1" VerticalAlignment="Center" />
<datavis:Title Content="{TemplateBinding Content}" VerticalAlignment="Center"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
</Style>
可能有人需要这个未来... HTTP://stackoverflow.com/questions/27417437/assigning-color-to-the-rectangle-近传奇项功能于WPF的工具包,图表线/ 27419445#27419445 – 2014-12-25 17:10:09