Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 2011

Binding Graph Datasource and Axes Label to a Collection

$
0
0

I currently have an ObservableCollection<T> containing several signal objects each with properties defining xy data, axis labels etc. This observable collection has been defined as a dependency property of the window to allow me to perform all my bindings in the xaml code.

 

I am finding the graph datasource binding only works if i specify a single signal in the collection to display, but i would like to display the xy data for all the signals. Is there a way of doing this?

 

For example

DataContext="{Binding ElementName=Window1, Path=GraphCollection}" DataSource="{Binding Path=[0].DataXY}"         This works

DataContext="{Binding ElementName=Window1, Path=GraphCollection}" DataSource="{Binding Path=DataXY}"   Does not work

 

FYI the DataXY for each signal is defined as an array of points.

 

I am also having problems binding the graph axis to the same collection. I am finding this binding does not work at all.

 

Label="{Binding ElementName=Window1.GraphCollection, Path=[0].XLabel}"


If i apply the same binding but in the code behind it works perfectly!!

            Binding bTemp = new Binding();
            bTemp.Source = this.GraphCollection;
            bTemp.Path = new PropertyPath("[0].XLabel");
            AxisDouble temp = graph1.Axes[0] as AxisDouble;
            BindingOperations.SetBinding(temp,AxisDouble.LabelProperty,bTemp);


Viewing all articles
Browse latest Browse all 2011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>