I'm having problems binding my MVVM ViewModel to the ChartSeriesProvider. It's like it's not a part of the Visual Tree.
and inside the ViewModel that is bound to this view (is its DataContext)
Everything else in the View binds ok but I always get no series and according to Snoop
RadChartView Cannot find governing FrameworkElement or FrameworkContentElement for target element
<
telerik:RadCartesianChart
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.SeriesProvider
>
<
telerik:ChartSeriesProvider
Source
=
"{Binding Path=CollectionView}"
>
<
telerik:ChartSeriesProvider.SeriesDescriptors
>
<
telerik:CategoricalSeriesDescriptor
ItemsSourcePath
=
"Items"
ValuePath
=
"Value"
CategoryPath
=
"Month"
>
<
telerik:CategoricalSeriesDescriptor.Style
>
<
Style
TargetType
=
"telerik:LineSeries"
>
</
Style
>
</
telerik:CategoricalSeriesDescriptor.Style
>
</
telerik:CategoricalSeriesDescriptor
>
</
telerik:ChartSeriesProvider.SeriesDescriptors
>
</
telerik:ChartSeriesProvider
>
</
telerik:RadCartesianChart.SeriesProvider
>
</
telerik:RadCartesianChart
>
and inside the ViewModel that is bound to this view (is its DataContext)
private
ICollectionView _collectionView;
public
ICollectionView CollectionView
{
get
{
if
(
this
._collectionView ==
null
)
{
this
._collectionView = CollectionViewSource.GetDefaultView(
this
.Items);
using
(
this
._collectionView.DeferRefresh())
{
this
._collectionView.SortDescriptions.Clear();
this
._collectionView.SortDescriptions.Add(
new
SortDescription(
"Order"
, ListSortDirection.Ascending));
}
}
return
this
._collectionView;
}
}
Everything else in the View binds ok but I always get no series and according to Snoop
RadChartView Cannot find governing FrameworkElement or FrameworkContentElement for target element