Added Accent color settings

This commit is contained in:
2020-07-10 22:42:06 +02:00
parent 22b5a433e9
commit 94f5eced01
5 changed files with 147 additions and 101 deletions

View File

@@ -1,8 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using Microsoft.Win32;
using ModernWpf;
using ModernWpfPlayground.MvvmStuff;
@@ -94,6 +96,24 @@ namespace ModernWpfPlayground
set => SetProperty(value, SetTheme);
}
public AccentColor AccentColor
{
get => GetProperty(AccentColor.Green);
set => SetProperty(value, SetAccentColor);
}
private static void SetAccentColor(AccentColor accentColor)
{
ThemeManager.Current.AccentColor = accentColor switch
{
AccentColor.Green => Color.FromArgb(255, 0, 86, 76),
AccentColor.Yellow => Color.FromArgb(255, 164, 144, 0),
AccentColor.Blue => Color.FromArgb(255, 0, 120, 215),
AccentColor.Purple => Color.FromArgb(255, 104, 33, 122),
_ => throw new ArgumentOutOfRangeException(nameof(accentColor), accentColor, null)
};
}
public int WindowWidth
{
get => GetProperty(1200);