Problems binding decimal value to listview label - only in IOS in testflight

LiamMillarLiamMillar GBMember

Hi
I am having problems binding a decimal value to a label in my listview. Everything is working as it should on Android, the only problem is with IOS in testflight (works ok in Debug).

I have tried creating an IValueConvertor:

public class DecimalConvertor:IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var s = (decimal)value;
return s.ToString();
}

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        var s = value as string;
        return decimal.Parse(s);
    }

}

//binding the value
storeDistance1.SetBinding(Label.TextProperty,
new Binding("Distance", BindingMode.OneWay, new DecimalConvertor()));

I have also tried:

storeDistance1.SetBinding(Label.TextProperty,
new Binding("Distance", stringFormat:"{0}"));

But no luck, please could someone help me

Thanks in advance

Posts

Sign In or Register to comment.