I've got the following collection, which serves as a global storage for a group of LineSeries ItemsSources for a chart.
public ObservableCollection<ObservableCollection<Data>> AllDataSeries;
The said collection may change every now and then, when it's reset I clear the chart from all series - and when it's re-populating again I'm adding as many series to the chart as the AllDataSeries.Count
tells me to.
At this point I need to set the binding.
for(int i = 0; i < AllDataSeries.Count; i++)
{
var series = new LineSeries { IndependentValuePath = "X", DependentValuePath = "Y", Title = "SomeSeriesTitle" };
Binding binding = new Binding("#?????#");
binding.Mode = BindingMode.TwoWay;
binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
series.SetBinding(ListView.ItemsSourceProperty, binding);
MyChart.Series.Add(series);
}
The thing is, I have no ide how to compose the Path for the binding. I tried :
String.Format("AllDataSeries[{0}]", i)
but it didn't work.
How should I set the Path property on the binding ?