I'm able to add string properties to my control; but I can't get it to work with boolean ones.
i.e
`//in my custom control
public static readonly BindableProperty EnabledProperty = BindableProperty.Create ("EnabledFlag", typeof(bool), typeof(bool), true);
public bool EnabledFlag {
get{ return (bool)GetValue (EnabledProperty); }
set {
SetValue (EnabledProperty, value);
UpdateButtonImage ();
}
}
//in my xaml
<localControls:ExtendedButton
x:Name ="SpaceButton"
EnabledFlag="false"
WORKS
<localControls:ExtendedButton
x:Name ="SpaceButton"
EnabledFlag="true"
WORKS
<localControls:ExtendedButton
x:Name ="SpaceButton"
EnabledFlag="{Binding IsSpaceViewEnabled}"
//doens't work - exception : "cannot assign property EnabledFlag type mismatch between Xmarin.Forms.Binding and System.Boolean
....
`
my view model (which corresponds to the Binding above) has the IsSpaceViewEnabledProperty as such
` bool _isSpaceViewEnabled;
public bool IsSpaceViewEnabled { get { return _isSpaceViewEnabled; } set { SetProperty (ref _isSpaceViewEnabled, value); } }
and the viewnodel extends ObservableObject
`