Esempio n. 1
0
        static void OnIconChanged(BindableObject bindable, object oldValue, object newValue)
        {
            if (newValue == null || bindable.IsSet(FlyoutIconProperty))
            {
                return;
            }

            var shellItem = (BaseShellItem)bindable;

            shellItem.FlyoutIcon = (ImageSource)newValue;
        }
Esempio n. 2
0
        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)));
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 internal static bool GetLoadAsAnimation(BindableObject bindable)
 {
     return(bindable.IsSet(IsAnimationPlayingProperty));
 }