Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

System.InvalidCastException: Object must implement IConvertible - Xamarin Footer iOS

$
0
0

I'm having this exception every time I try to set a footer on ios:

System.InvalidCastException: Object must implement IConvertible.
  at System.Convert.ChangeType (System.Object value, System.Type conversionType, IFormatProvider provider) [0x0005a] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/convert.cs:343
  at Xamarin.Forms.BindingExpression.TryConvert (Xamarin.Forms.BindingExpressionPart part, System.Object& value, System.Type convertTo, Boolean toTarget) [0x00034] in <filename unknown>:0

when I call:

listView.Footer = foot;

Where foot is from type:

public class Model_Footer
    {
        public int pt1 { get; set; }
        public string pt2 { get; set; }
        public double pt3 { get; set; }
        public double pt4 { get; set; }

        public Model_Footer ()
        {
        }
    }

This exception do not crash the app, but the footer do not work as expected.

My footer template is from a type that implements a contentView:

footerTemplate = new DataTemplate (typeof(FooterCell)); 
listView.FooterTemplate = footerTemplate; 

public class FooterCell : ContentView 

if I understand right the footer functionality the listview.Footet should be the binding context for listview.FooterTemplate...
And it works as expected in Android.

Anyone can give a help?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>