
Good morning, I have binding errors when I use XYChart in multiple document windows within one Docking site.
In a Docking site I created two documents that draw the exact same chart.
Here is a test code that shows the issue:
Here the runtime errors:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=xAxis1'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'XAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=yAxis11'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'YAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=xAxis1'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'XAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=yAxis12'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'YAxis' (type 'XYAxisBase')
If I simply swap the order of the document windows, first Chart2 and then Chart1:
Now I have these runtime errors:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=xAxis'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'XAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=yAxis1'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'YAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=xAxis'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'XAxis' (type 'XYAxisBase')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=yAxis2'. BindingExpression:(no path); DataItem=null; target element is 'LineSeries' (Name=''); target property is 'YAxis' (type 'XYAxisBase')
Alone the Chart1 and Chart2 documents do not give errors and work while when both are present the second document gives binding errors.
If necessary, here is the code that generates the charts data: