Created
August 22, 2015 12:40
-
-
Save ButchersBoy/01d288110ed46a76c7b1 to your computer and use it in GitHub Desktop.
Changing Accent color in VB.Net #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Application x:Class="Application" | |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
| StartupUri="MainWindow.xaml"> | |
| <Application.Resources> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <!-- MahApps --> | |
| <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> | |
| <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> | |
| <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> | |
| <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" /> | |
| <!-- Material --> | |
| <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" /> | |
| <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" /> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Red.xaml" /> | |
| </ResourceDictionary.MergedDictionaries> | |
| <SolidColorBrush x:Key="PrimaryHueLightBrush" Color="{StaticResource Primary100}"/> | |
| <SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="{StaticResource Primary100Foreground}"/> | |
| <SolidColorBrush x:Key="PrimaryHueMidBrush" Color="{StaticResource Primary500}"/> | |
| <SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="{StaticResource Primary500Foreground}"/> | |
| <SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="{StaticResource Primary700}"/> | |
| <SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="{StaticResource Primary700Foreground}"/> | |
| <SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource Primary700}" /> | |
| <SolidColorBrush x:Key="AccentColorBrush" Color="{StaticResource Primary500}" /> | |
| <SolidColorBrush x:Key="AccentColorBrush2" Color="{StaticResource Primary400}" /> | |
| <SolidColorBrush x:Key="AccentColorBrush3" Color="{StaticResource Primary300}" /> | |
| <SolidColorBrush x:Key="AccentColorBrush4" Color="{StaticResource Primary200}" /> | |
| <SolidColorBrush x:Key="WindowTitleColorBrush" Color="{StaticResource Primary700}" /> | |
| <SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{StaticResource Primary500Foreground}" /> | |
| <LinearGradientBrush x:Key="ProgressBrush" EndPoint="0.001,0.5" StartPoint="1.002,0.5" > | |
| <GradientStop Color="{StaticResource Primary700}" Offset="0" /> | |
| <GradientStop Color="{StaticResource Primary300}" Offset="1" /> | |
| </LinearGradientBrush> | |
| <SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource Primary500}" /> | |
| <SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource Primary500}" /> | |
| <SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource Primary500Foreground}" /> | |
| <SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{StaticResource Primary500}" Opacity="0.4" /> | |
| </ResourceDictionary> | |
| <ResourceDictionary> | |
| <ResourceDictionary.MergedDictionaries> | |
| <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/MaterialDesignColor.Amber.xaml" /> | |
| </ResourceDictionary.MergedDictionaries> | |
| <SolidColorBrush x:Key="SecondaryAccentBrush" Color="{StaticResource Accent200}"/> | |
| <SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="{StaticResource Accent200Foreground}"/> | |
| </ResourceDictionary> | |
| </ResourceDictionary.MergedDictionaries> | |
| </ResourceDictionary> | |
| </Application.Resources> | |
| </Application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Class MainWindow | |
| Private Sub LightThemeCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles LightThemeCheckBox.Checked | |
| DarkThemeCheckBox.IsChecked = False | |
| Dim materialPaletteHelper = New MaterialDesignThemes.Wpf.PaletteHelper | |
| materialPaletteHelper.SetLightDark(False) | |
| End Sub | |
| Private Sub DarkThemeCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles DarkThemeCheckBox.Checked | |
| LightThemeCheckBox.IsChecked = False | |
| Dim materialPaletteHelper = New MaterialDesignThemes.Wpf.PaletteHelper | |
| materialPaletteHelper.SetLightDark(True) | |
| End Sub | |
| Private Sub GreenAccentCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles GreenAccentCheckBox.Checked | |
| Dim materialPaletteHelper = New MaterialDesignThemes.Wpf.PaletteHelper | |
| materialPaletteHelper.ReplacePrimaryColor("Green") | |
| materialPaletteHelper.ReplaceAccentColor("Green") | |
| RedAccentCheckBox.IsChecked = False | |
| CyanAccentCheckBox.IsChecked = False | |
| End Sub | |
| Private Sub RedAccentCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles RedAccentCheckBox.Checked | |
| Dim materialPaletteHelper = New MaterialDesignThemes.Wpf.PaletteHelper | |
| materialPaletteHelper.ReplacePrimaryColor("Red") | |
| materialPaletteHelper.ReplaceAccentColor("Red") | |
| GreenAccentCheckBox.IsChecked = False | |
| CyanAccentCheckBox.IsChecked = False | |
| End Sub | |
| Private Sub CyanAccentCheckBox_Checked(sender As Object, e As RoutedEventArgs) Handles CyanAccentCheckBox.Checked | |
| Dim materialPaletteHelper = New MaterialDesignThemes.Wpf.PaletteHelper | |
| materialPaletteHelper.ReplacePrimaryColor("Cyan") | |
| materialPaletteHelper.ReplaceAccentColor("Cyan") | |
| GreenAccentCheckBox.IsChecked = False | |
| RedAccentCheckBox.IsChecked = False | |
| End Sub | |
| Private Sub LightThemeCheckBox_Unchecked(sender As Object, e As RoutedEventArgs) Handles LightThemeCheckBox.Unchecked | |
| DarkThemeCheckBox.IsChecked = True | |
| End Sub | |
| Private Sub DarkThemeCheckBox_Unchecked(sender As Object, e As RoutedEventArgs) Handles DarkThemeCheckBox.Unchecked | |
| LightThemeCheckBox.IsChecked = True | |
| End Sub | |
| End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment