mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-12-14 16:16:24 +01:00
Added Accent color settings
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user