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

Xaml does not support Nullable type property, doesn't it?

$
0
0

I have a class with a Nullable type,

public class MyEntry : RelativeLayout
{
public static readonly BindableProperty MyEnumProperty = BindableProperty.Create<MyEntry, TEnum?>(p => p.MyEnum, CustomRenderer.TEnum.e2);
public TEnum? MyEnum
{
get { return (TEnum?)GetValue(MyEnumProperty); }
set { SetValue(MyEnumProperty, value); }
}
}

And set the property in Xaml

This will raise an exception "No Property of name MyEnum found"
If I delete the ? and it will work fine.

So does not xaml support nullable type?
I have attached the sample (WinPhone). I am appreciated if anyone could take a look at it.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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