public static void SetOnAppTheme <T>(this BindableObject self, BindableProperty targetProperty, T light, T dark, T defaultValue = default)
        {
            ExperimentalFlags.VerifyFlagEnabled(nameof(BindableObjectExtensions), ExperimentalFlags.AppThemeExperimental, nameof(BindableObjectExtensions), nameof(SetOnAppTheme));

            var appTheme = new OnAppTheme <T> {
                Light = light, Dark = dark, Default = defaultValue
            };

            self.SetBinding(targetProperty, appTheme);
        }
예제 #2
0
        internal static void VerifyExperimental([CallerMemberName] string memberName = "", string constructorHint = null)
        {
            if (isExperimentalFlagSet)
            {
                return;
            }

            ExperimentalFlags.VerifyFlagEnabled(nameof(Markup), ExperimentalFlags.ExpanderExperimental, constructorHint, memberName);

            isExperimentalFlagSet = true;
        }
예제 #3
0
 public static void VerifySwipeViewFlagEnabled(
     string constructorHint = null,
     [CallerMemberName] string memberName = "")
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(SwipeView), ExperimentalFlags.SwipeViewExperimental, memberName: memberName);
 }
예제 #4
0
        public AppThemeColor()
        {
            ExperimentalFlags.VerifyFlagEnabled(nameof(AppThemeColor), ExperimentalFlags.AppThemeExperimental, nameof(AppThemeColor));

            Application.Current.RequestedThemeChanged += RequestedThemeChanged;
        }
예제 #5
0
 public StateTriggerBase()
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(IndicatorView), ExperimentalFlags.StateTriggersExperimental);
 }
예제 #6
0
 public IndicatorView()
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(IndicatorView), ExperimentalFlags.IndicatorViewExperimental);
 }
예제 #7
0
 public StateTriggerBase()
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(StateTriggerBase), ExperimentalFlags.StateTriggersExperimental);
 }
예제 #8
0
 public static void VerifyMediaElementFlagEnabled(
     string constructorHint = null,
     [CallerMemberName] string memberName = "")
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(MediaElement), ExperimentalFlags.MediaElementExperimental, memberName: memberName);
 }
예제 #9
0
 public static void VerifyCollectionViewFlagEnabled(
     string constructorHint = null,
     [CallerMemberName] string memberName = "")
 {
     ExperimentalFlags.VerifyFlagEnabled(nameof(CollectionView), ExperimentalFlags.CollectionViewExperimental);
 }