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
595
DataTemplate for a Marker, Is setting visibilty property not possible?
posted

I need to be able to set point labels as a feature that can be turned on or off by the user. For some reason using my BooleanToVisibilityConverter has no effect on the Textblock that displays my pointdata. I have checked my converter to ensure it is being triggered and getting the right data and it is. I'm using this converter with no issue elsewhere. I added a textblock to display the Visibility property of my PointData Textblock and it always displays the setting 'Visible'. Just for the heck of it I used the same Visibility binding line from my PointData textblock for my chart title and it worked just fine. Does anyone have an idea what the issue is?

 

 

<DataTemplate x:Key="CircleMarkerTemplate">
           
            <Grid Background="Transparent">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="160"/>
                    <ColumnDefinition Width="24"/>
                    <ColumnDefinition Width="160"/>
                </Grid.ColumnDefinitions>
               
                <Grid.RowDefinitions>
                    <RowDefinition Height="24"/>
                    <RowDefinition Height="24"/>
                    <RowDefinition Height="24"/>
                </Grid.RowDefinitions>

                <Ellipse  Grid.Row="1" Grid.Column="1"         
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"                
                 Fill="{Binding ActualItemBrush}"
                 Stroke="{Binding Series.ActualMarkerOutline}"
                 StrokeThickness="0.5"
                 Width="{Binding Source={x:Static local:MySettings.Default}, Path=tmMarkerSize}"  
                 Height="{Binding Source={x:Static local:MySettings.Default}, Path=tmMarkerSize}"/>


                <TextBlock x:Name="txblCirclePL" Grid.Row="0" Grid.Column="2" Text="{Binding     Item.PointLabel}"
                           Visibility= "{Binding ElementName=ChartControl,Path=DataContext.PointLabelsIsVisible, Mode=OneWay,
                       UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BooleanToVisibilityConverter}}"/>
               
                <TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding ElementName= txblCirclePL, Path=Visibility}"/>
            </Grid>
        </DataTemplate>