Hi,
I am trying to implement a binding for some properties of SeriesDefinition for RadChart in XAML. Here is a part of my XAML:
This binding works fine, it gets the value from my ViewModel, so series are either visible on invisible.
The issue is the following:
I have a CheckBox on my View (UserControl defined in XAML) which is also binded to the same property of ViewModel (ChartRateSeriesVisible property). And I want to control the visibility of a series by clicking on the checkbox. CheckBox's binding is defined property. I can see in the trace that checking/unchecking the checkbox updates the value of ChartRateSeriesVisible property.
But chart is not updated automatically. Only then I reload the chart completely (by updating its ItemsSource for instance), my LineSeries is hidden or visible depending on the value of ChartRateSeriesVisible.
What am I doing wrong or what am I missing?
In the telerik's sample application 'Simple Filtering' almost the same approach is used! Series Visiblity property is also binded to the ViewModel's property, etc.
I am using WPF 3.5 and the version of telerik assemblies is 2010.2.924.35.
Thanks in advance.
I am trying to implement a binding for some properties of SeriesDefinition for RadChart in XAML. Here is a part of my XAML:
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
LegendLabel
=
"Rates"
CollectionIndex
=
"1"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:LineSeriesDefinition
AxisName
=
"Rate"
ItemLabelFormat
=
"0.00 \%"
>
<
telerik:LineSeriesDefinition.Visibility
>
<
Binding
Path
=
"ChartRateSeriesVisible"
Source
=
"{StaticResource ViewModel}"
Converter
=
"{StaticResource BooleanToSeriesVisibilityConverter}"
/>
</
telerik:LineSeriesDefinition.Visibility
>
</
telerik:LineSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
This binding works fine, it gets the value from my ViewModel, so series are either visible on invisible.
The issue is the following:
I have a CheckBox on my View (UserControl defined in XAML) which is also binded to the same property of ViewModel (ChartRateSeriesVisible property). And I want to control the visibility of a series by clicking on the checkbox. CheckBox's binding is defined property. I can see in the trace that checking/unchecking the checkbox updates the value of ChartRateSeriesVisible property.
But chart is not updated automatically. Only then I reload the chart completely (by updating its ItemsSource for instance), my LineSeries is hidden or visible depending on the value of ChartRateSeriesVisible.
What am I doing wrong or what am I missing?
In the telerik's sample application 'Simple Filtering' almost the same approach is used! Series Visiblity property is also binded to the ViewModel's property, etc.
I am using WPF 3.5 and the version of telerik assemblies is 2010.2.924.35.
Thanks in advance.