static void OnIconChanged(BindableObject bindable, object oldValue, object newValue) { if (newValue == null || bindable.IsSet(FlyoutIconProperty)) { return; } var shellItem = (BaseShellItem)bindable; shellItem.FlyoutIcon = (ImageSource)newValue; }
static void BindProperty(BindableObject content, BindableProperty property, Type type) { if (content.IsSet(property) || content.GetIsBound(property)) { // Don't override the property if user has already set it return; } content.SetBinding(property, new Binding(property.PropertyName, source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor, type))); }
public static T GetPropertyIfSet <T>(this BindableObject bindableObject, BindableProperty bindableProperty, T returnIfNotSet) { if (bindableObject == null) { return(returnIfNotSet); } if (bindableObject.IsSet(bindableProperty)) { return((T)bindableObject.GetValue(bindableProperty)); } return(returnIfNotSet); }
internal static bool GetLoadAsAnimation(BindableObject bindable) { return(bindable.IsSet(IsAnimationPlayingProperty)); }