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
312
xamDataGrid, Converter w/ culture
posted

I have a result set that has an Amount property and a Currency object w/ a Culture property.
i.e.
myItem.Amount                   (decimal)
myItem.Currency.Culture   (contains the value en-US, or de-DE as a string)

Each record's amount can be of a different culture.
I already have a converter working via xaml that performs an (Amount * -1) and then uses a string.format w/ a format of C2 and the given culture so the proper currency format shows, just not getting the proper CultureInfo passed in; how do I get the myItem.Currency.Culture string property to the converter as the CultureInfo parameter.  (If I have to change the Culture property to a CultureInfo object I will)

Can someone please provide an example of how I might do this?

This is what I currently have working:
xmlns:Converters="clr-namespace:AppName.Converters"

 <igDP:Field Name="Amount">
<igDP:Field.Settings>
<igDP:FieldSettings AllowEdit="False" EditAsType="{x:Type sys:String}"/>
</igDP:Field.Settings>
<igDP:Field.Converter>
<Converters:NegateAmount/>
</igDP:Field.Converter>
</igDP:Field>

 

TIA!
Jason