9

I am newbie in WPF and now I am using a 3rd party lib xamChart in my project

previously in the XAML i have a Chart and its axis has a Unit which is a int property and I have

Unit="{Binding NextStartRow, Converter={StaticResource UnitConverter}}"

This works perfectly, but now I need to create the chart in the runtime through the code behind. How can I do that in C#? and FYI all the axis.Unit.xxx in the c# code do not have the thing I want, Please help, thank you very much in advance, any suggestion is much appreciated!

FYI code snippet in of xaml

<igCA:Axis AxisType="PrimaryX" AutoRange="True"  
           Unit="{Binding AnotherIntegerProperty, Converter={StaticResource UnitConverter}}">
H.B.
  • 166,899
  • 29
  • 327
  • 400
Ted Xu
  • 1,095
  • 1
  • 11
  • 20

1 Answers1

27

Try this by adjusting anything is not correct as you missed to specify:

myXamChart.SetBinding(
  Unit,
  new Binding("AnotherIntegerProperty")
  {
    Converter = new UnitConverter()
  });

Cheers

Mario Vernari
  • 6,649
  • 1
  • 32
  • 44