Hello,
I can databind linechart to custom IEnumerable collection, this is done with ObjectDataProvider in XAML like this:
In <Window.Resources>:
<ObjectDataProvider x:Key="PatientData" ObjectType="{x:Type local:PatientDataReader}" MethodName="GetData"/>
In <XamChart>:
StrokeThickness="3"
DataSource="{Binding Source={StaticResource PatientData}}"
DataMapping="Label=Name; Value=Age">
</igCA:Series>
However, now need to change the binding in runtime, it requires code in C# code-behind file.
How is this done? Should I use DataContext or what?
-pom-
Ha! Sometimes one just comes up with the solution right after the question is asked.
This is the solution in the code behind:
provider.MethodName = "GetData2";
This will dynamically change the method on the bound object to another! Not actually XamChart feature but a general WPF feature.