Beispiel #1
0
        // -------------------------------------------------------------------
        // Public
        // -------------------------------------------------------------------
        public static Color GetColorValue(this UITheme theme, ThemeColorType colorType)
        {
            switch (colorType)
            {
            case ThemeColorType.Primary:
            {
                return(theme.PrimaryColor);
            }

            case ThemeColorType.Secondary:
            {
                return(theme.SecondaryColor);
            }

            case ThemeColorType.Accent1:
            {
                return(theme.Accent1Color);
            }

            case ThemeColorType.Accent2:
            {
                return(theme.Accent2Color);
            }

            case ThemeColorType.FontDefault:
            {
                return(theme.FontColorDefault);
            }

            default:
            {
                return(Color.white);
            }
            }
        }
Beispiel #2
0
 public Theme(ThemeColorType color)
 {
     this.Color = color;
     if (color == ThemeColorType.White)
     {
         Theme.BackGround = ConsoleColor.White;
         Theme.Contrast   = ConsoleColor.Black;
         Theme.Light      = ConsoleColor.Gray;
         Theme.Red        = ConsoleColor.DarkRed;
         Theme.Green      = ConsoleColor.DarkGreen;
         Theme.Blue       = ConsoleColor.Blue;
         Theme.Magenta    = ConsoleColor.DarkMagenta;
     }
     else if (color == ThemeColorType.Black)
     {
         Theme.BackGround = ConsoleColor.Black;
         Theme.Contrast   = ConsoleColor.White;
         Theme.Light      = ConsoleColor.DarkGray;
         Theme.Red        = ConsoleColor.Red;
         Theme.Green      = ConsoleColor.Green;
         Theme.Blue       = ConsoleColor.Cyan;
         Theme.Magenta    = ConsoleColor.DarkMagenta;
     }
     else if (color == ThemeColorType.Blue)
     {
         Theme.BackGround = ConsoleColor.DarkBlue;
         Theme.Contrast   = ConsoleColor.Yellow;
         Theme.Light      = ConsoleColor.DarkGray;
         Theme.Red        = ConsoleColor.Red;
         Theme.Green      = ConsoleColor.White;
         Theme.Blue       = ConsoleColor.Magenta;
         Theme.Magenta    = ConsoleColor.Cyan;
     }
 }
 private static void Update(DependencyObject dependencyObject, ThemeColorType color)
 {
     try
     {
         if (color != ThemeColorType.BoundColor)
         {
             GetColorProeprty(dependencyObject);
             Binding binding = new Binding(color.ToString() + "Color")
             {
                 Source = PaletteInstance
             };
             BindingOperations.SetBinding(dependencyObject, SolidColorBrush.ColorProperty, binding);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
        private void RectChanger(Brush mainBrush, ThemeColorType themeColor, bool visible)
        {
            //Change Brush
            shadowRectangle.Fill  = mainBrush;
            shadowRectangle1.Fill = mainBrush;
            shadowRectangle2.Fill = mainBrush;
            shadowRectangle3.Fill = mainBrush;
            shadowRectangle4.Fill = mainBrush;
            shadowRectangle5.Fill = mainBrush;
            shadowRectangle6.Fill = mainBrush;
            shadowRectangle7.Fill = mainBrush;
            shadowRectangle8.Fill = mainBrush;
            resizeShadow.Fill     = mainBrush;

            //Toggle Dropshadow Visibility
            ((DropShadowEffect)shadowRectangle.Effect).Opacity  = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle1.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle2.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle3.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle4.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle5.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle6.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle7.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)shadowRectangle8.Effect).Opacity = visible == true ? 1 : 0;
            ((DropShadowEffect)resizeShadow.Effect).Opacity     = visible == true ? 1 : 0;

            //Change Style Of Button
            applyandexitbutton.Style  = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            applySettingsButton.Style = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            closeSettingsButton.Style = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            hideButton.Style          = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            resizeButton.Style        = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            sendButton.Style          = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["TitleBarModernButton"] : (Style)Application.Current.Resources["ModernDarkButton"];
            MmTb.Style = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["ToggleModernButton"] : (Style)Application.Current.Resources["DarkToggleModernButton"];
            MiTb.Style = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["ToggleModernButton"] : (Style)Application.Current.Resources["DarkToggleModernButton"];
            MaTb.Style = themeColor == ThemeColorType.White ? (Style)Application.Current.Resources["ToggleModernButton"] : (Style)Application.Current.Resources["DarkToggleModernButton"];
        }
 public static void SetColor(DependencyObject obj, ThemeColorType value)
 {
     obj.SetValue(ColorProperty, value);
 }
 internal static DependencyProperty GetColorProperty(ThemeColorType color)
 {
     return colorProperties[(int) color];
 }