private ChangeColor ( Color back, Color fore, |
||
back | Color | |
fore | Color | |
foreground | ||
Résultat | void |
public DetailsPage() { this.InitializeComponent(); Context.FetchDataCompleted += Context_FetchDataCompleted; baba.ChangeColor(new SolidColorBrush(Colors.White)); baba.ChangeColor(Colors.Transparent, Colors.White, new SolidColorBrush(Colors.White)); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); Color c; SolidColorBrush s; if (Context.Theme == ElementTheme.Dark) { var d = this.Resources.ThemeDictionaries["Dark"] as ResourceDictionary; c = (Color)d["SystemBaseHighColor"]; s = (SolidColorBrush)d["SystemControlForegroundBaseHighBrush"]; } else if (Context.Theme == ElementTheme.Light) { var d = this.Resources.ThemeDictionaries["Light"] as ResourceDictionary; c = (Color)d["SystemBaseHighColor"]; s = (SolidColorBrush)d["SystemControlForegroundBaseHighBrush"]; } else { c = (Color)Resources["SystemBaseHighColor"]; s = (SolidColorBrush)Resources["SystemControlForegroundBaseHighBrush"]; } baba.ChangeColor(Colors.Transparent, c, s); }
private void Context_TimeUpdated(object sender, TimeUpdatedEventArgs e) { detailGridAnimation_FLAG[4] = false; DetailGrid4Play(); baba.ReloadTheme(); if (e.IsDayNightChanged) { if ((Context.Condition == WeatherCondition.sunny) || (Context.Condition == WeatherCondition.windy) || (Context.Condition == WeatherCondition.calm) || (Context.Condition == WeatherCondition.light_breeze) || (Context.Condition == WeatherCondition.moderate) || (Context.Condition == WeatherCondition.fresh_breeze) || (Context.Condition == WeatherCondition.strong_breeze) || (Context.Condition == WeatherCondition.high_wind) || (Context.Condition == WeatherCondition.gale)) { WeatherCanvas.ChangeCondition(Context.Condition, Context.IsNight, Context.IsSummer); if (!Context.IsNight) { var s = new SolidColorBrush(Colors.Black); baba.ChangeColor(s); RefreshButton.Foreground = s; } else { baba.ChangeColor(new SolidColorBrush(Colors.White)); RefreshButton.Foreground = new SolidColorBrush(Colors.White); } } } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter is string) { HeaderGrid.Visibility = Visibility.Collapsed; var length = new GridLength(0); Root.RowDefinitions[0].Height = length; Root.RowDefinitions[1].Height = length; } else { Color c; SolidColorBrush s; if (Context.Theme == ElementTheme.Dark) { var d = this.Resources.ThemeDictionaries["Dark"] as ResourceDictionary; c = (Color)d["SystemBaseHighColor"]; s = (SolidColorBrush)d["SystemControlForegroundBaseHighBrush"]; } else if (Context.Theme == ElementTheme.Light) { var d = this.Resources.ThemeDictionaries["Light"] as ResourceDictionary; c = (Color)d["SystemBaseHighColor"]; s = (SolidColorBrush)d["SystemControlForegroundBaseHighBrush"]; } else { c = (Color)Resources["SystemBaseHighColor"]; s = (SolidColorBrush)Resources["SystemControlForegroundBaseHighBrush"]; } if (baba != null) { baba.ChangeColor(Colors.Transparent, c, s); } if (!license.IsPurchased) { RefreshButton.IsEnabled = false; } } }