Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
binding LegendTemplate Visibility to Series.Visibility not working
posted

I have 6 lineseries, it can show/hide by user selection. The legend should be show/hide with it's series. so in the LegendTemplate:

<DataTemplate x:Key="LegendTemplate">

    <Border BorderThickness="0.5" CornerRadius="5" Visibility="{Binding Series.Visibility}" >

                <StackPanel Orientation="Horizontal">            

                           <Rectangle Fill="{Binding ActualItemBrush}" Width="20" Height="10" Margin="2" />

              <TextBlock Text="{Binding Series.Title}" Margin="0,0,5,0" />

 

But the legend still shows up even the lines are not showing.