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

Nullable Type issue in Xaml ?

$
0
0

Hi all, my class have a property as following.

public int? MyNumber
{    
        get { return (int?)GetValue(MyNumberProperty); }    
        set { SetValue(MyNumberProperty, value); }
}

And I set a value to it in XAML
MyNumber="2"

I noticed it will raise an exception (No Property of name MyNumber found)

If I remove the "?", it will work correctly.

Nullable type can not be used in XAML?


Viewing all articles
Browse latest Browse all 58056

Trending Articles