在Xamarin中,我编写了一个扩展为Grid
的bindableproperties的类public static readonly BindableProperty TextColorProperty = BindableProperty.Create ("TextColor", typeof(Color), typeof(EXButton), Color.Default, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty TextProperty = BindableProperty.Create ("Text", typeof(string), typeof(EXButton), "", BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty TextXAlignmentProperty = BindableProperty.Create ("TextXAlignment", typeof(TextAlignment), typeof(EXButton), TextAlignment.Start, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty TextYAlignmentProperty = BindableProperty.Create ("TextYAlignment", typeof(TextAlignment), typeof(EXButton), TextAlignment.Center, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty SubTextColorProperty = BindableProperty.Create ("SubTextColor", typeof(Color), typeof(EXButton), Color.Default, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty SubTextProperty = BindableProperty.Create ("SubText", typeof(string), typeof(EXButton), "", BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty ImageProperty = BindableProperty.Create ("Image", typeof(ImageSource), typeof(EXButton), null, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty ImagePositionProperty = BindableProperty.Create ("ImagePosition", typeof(ImagePositions), typeof(EXButton), ImagePositions.Left, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty ImageBoundsProperty = BindableProperty.Create ("ImageBounds", typeof(EXBounds), typeof(EXButton), EXBounds.Zero, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty ImagePaddingProperty = BindableProperty.Create ("ImagePadding", typeof(Thickness), typeof(EXButton), new Thickness(0), BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty LeftBarColorProperty = BindableProperty.Create ("LeftBarColor", typeof(Color), typeof(EXButton), Color.Default, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty BackgroundResourceProperty = BindableProperty.Create ("BackgroundResource", typeof(string), typeof(EXButton), "", BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty TextFontProperty = BindableProperty.Create ("TextFont", typeof(Font), typeof(EXButton), Font.Default, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty SubTextFontProperty = BindableProperty.Create ("SubTextFont", typeof(Font), typeof(EXButton), Font.Default, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty DataProperty = BindableProperty.Create ("Data", typeof(object), typeof(EXButton), null, BindingMode.OneWay, null, null, null, null);
public static readonly BindableProperty ContentPaddingProperty = BindableProperty.Create ("ContentPadding", typeof(Thickness), typeof(EXButton), new Thickness(0), BindingMode.OneWay, null, null, null, null);
我在Android应用程序中创建了一个对象,然后编译它。
当我运行应用程序时,它会引发一个异常,并显示消息“无法加载类型'CreateDefaultValueDelegate'。”在对象创建上。我真的不明白这意味着什么。
感谢您的帮助。