Ejemplo n.º 1
0
        /// <summary>
        /// The SwitchModeCommandExecute.
        /// </summary>
        /// <returns>The <see cref="Task"/>.</returns>
        public static Task SwitchModeCommandExecute()
        {
            AppTheme appTheme = ThemeSettings.Theme;

            if (appTheme.Equals(AppTheme.Light))
            {
                Application.Current.Resources = new DarkTheme();

                IPlatformThemeManager platformManager = DependencyService.Get <IPlatformThemeManager>();

                platformManager?.ChangeTheme(AppTheme.Dark);

                ThemeSettings.Theme = AppTheme.Dark;
            }
            else
            {
                Application.Current.Resources = new LightTheme();

                IPlatformThemeManager platformManager = DependencyService.Get <IPlatformThemeManager>();

                // platformManager.ChangeTheme("light");
                platformManager?.ChangeTheme(AppTheme.Light);

                ThemeSettings.Theme = AppTheme.Light;
            }

            // App.MasterDetailPage.IsPresented = false;
            return(Task.FromResult(true));
        }
Ejemplo n.º 2
0
 public bool Equals(ApplicationDesign obj)
 {
     return(AccentColor.Equals(obj.AccentColor) && AppTheme.Equals(obj.AppTheme) &&
            ApplicationBackground != null && ApplicationBackground.Equals(obj.ApplicationBackground));
 }