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