internal void SetStyleTheme(StyleTheme theme)
        {
            var preferences = PreferenceManager.GetDefaultSharedPreferences(this).Edit();

            preferences.PutInt(nameof(StyleTheme), (int)theme);
            preferences.Apply();
            RestartActivity();
        }
示例#2
0
 public void SetThemeResources(StyleTheme theme)
 {
     if (theme == StyleTheme.Light)
     {
         App.Current.Resources = new LightTheme();
     }
     else
     {
         App.Current.Resources = new DarkTheme();
     }
 }
示例#3
0
 public void SetTheme(StyleTheme theme)
 {
     SetThemeResources(theme);
     _settingsService.StyleTheme = theme;
     _nativeThemeService.SetTheme(theme);
 }
 /// <summary>
 ///     Adds a color scheme to the list.
 /// </summary>
 /// <param name="styleTheme">The color scheme to add.</param>
 public void AddStyleTheme(StyleTheme styleTheme)
 {
     _styleThemeManager.AddStyleTheme(styleTheme);
 }
示例#5
0
 public void SetTheme(StyleTheme theme)
 {
     MainActivity.Instance.SetStyleTheme(theme);
 }