Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppearanceManager"/> class.
 /// </summary>
 private AppearanceManager()
 {
     DarkThemeCommand  = new RelayCommand(o => ThemeSource = DarkThemeSource, o => !DarkThemeSource.Equals(ThemeSource));
     LightThemeCommand = new RelayCommand(o => ThemeSource = LightThemeSource, o => !LightThemeSource.Equals(ThemeSource));
     SetThemeCommand   = new RelayCommand(o => {
         var uri = NavigationHelper.ToUri(o);
         if (uri != null)
         {
             ThemeSource = uri;
         }
     }, o => o is Uri || o is string);
     LargeFontSizeCommand = new RelayCommand(o => FontSize = FontSize.Large);
     SmallFontSizeCommand = new RelayCommand(o => FontSize = FontSize.Small);
     AccentColorCommand   = new RelayCommand(o => {
         if (o is Color)
         {
             AccentColor = (Color)o;
         }
         else
         {
             // parse color from string
             var str = o as string;
             if (str != null)
             {
                 AccentColor = (Color)ColorConverter.ConvertFromString(str);
             }
         }
     }, o => o is Color || o is string);
 }
Пример #2
0
        private void OnGoToPage(object target, ExecutedRoutedEventArgs e)
        {
            var newValue = NavigationHelper.ToUri(e.Parameter);

            SetCurrentValue(SourceProperty, newValue);
        }