Exemplo n.º 1
0
        //Setting the right icon for each theme
        private void SetTrayIcon()
        {
            var theme = RegistryThemeHelper.GetWindowsTheme();

            darkerIcon.IconSource = theme == UITheme.Light
                ? new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Resources/day_w.ico"));
        }
Exemplo n.º 2
0
        private void SetDarkerAppTheme()
        {
            var apptheme = RegistryThemeHelper.GetAppsTheme();

            if (apptheme == UITheme.Light)
            {
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
                {
                    Source = new Uri("/Resources/Themes/LightTheme.xaml", UriKind.Relative)
                });
            }
            else
            {
                Application.Current.Resources.MergedDictionaries.Clear();
                Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary()
                {
                    Source = new Uri("/Resources/Themes/DarkTheme.xaml", UriKind.Relative)
                });
            }
        }
Exemplo n.º 3
0
 //Reset menu item
 private void Reset_Click(object sender, RoutedEventArgs e)
 {
     RegistryThemeHelper.ResetTheme();
     SetTrayIcon();
     SetDarkerAppTheme();
 }