I'm working on a MVVM application.
The user can dynamically change the RadChart series color with the interface.
Code behind:
...
Binding strokeBinding = new Binding(".")
{
Source = dataSerie,
Mode = BindingMode.OneWay,
Path = new PropertyPath("Color"),
Converter = new ColorToBrushConverter()
};
BindingOperations.SetBinding(appearanceSettings, AppearanceSettings.StrokeProperty, strokeBinding);
...
The legend is automatically generated but colors do not change automatically with the series color.
I tried to turn auto genarated items to false and used a binding between the color and the legend MarkerFillProperty.
It sets the marker with the right color but if I change dynamically the color it doesn't work.
Code behind:
ChartLegend.UseAutoGeneratedItems = false;
...
ChartLegendItem chartLegendItem = new ChartLegendItem();
chartLegendItem.Label = dataSerie.LegendLabel;
Binding markerFillBinding = new Binding(".")
{
Source = dataSerie,
Mode = BindingMode.OneWay,
Path = new PropertyPath("Color"),
Converter = new ColorToBrushConverter()
};
Could you help me?
Regards,
Olivier