Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
755
XamChart Y Axis format binding
posted

Hello! 

I am trying to bind the format of the Y axis so that depending on a selection on the viewmodel, the Axis format updates, based on a given culture. 

So far the code looks like this : 

<igCA:Axis AxisType="PrimaryY" Language="{Binding CurrencyFormat, Mode=TwoWay}">
    <igCA:Axis.Label>
        <igCA:Label Format="{}{0:c}" />
    </igCA:Axis.Label>
</igCA:Axis>

and CurrencyFormat is defined on the ViewModel thusly:

private XmlLanguage _currencyFormat;

public XmlLanguage CurrencyFormat

{
    get { return _currencyFormat; }
    set
    {
        if (value != _currencyFormat)
        {
             _currencyFormat = value; 
            OnPropertyChanged("CurrencyFormat");
        }
    }
}

And instantiated with:

CurrencyFormat = XmlLanguage.GetLanguage(new CultureInfo("en-GB").Name);

This initial Binding works fine, but when changing the CurrencyFormat, the Chart doesnt update. 

Any suggestions?

Thanks, 

Parents
No Data
Reply
  • 755
    posted

    Ok after further testing, changing the Language attribute directly does not update the Currency shown, so Binding this property will definitely not work... Is there any way then to change the culture context of the control with Binding?

Children