diff --git a/App/AccentColor.cs b/App/AccentColor.cs
new file mode 100644
index 0000000..a01bfa5
--- /dev/null
+++ b/App/AccentColor.cs
@@ -0,0 +1,10 @@
+namespace ModernWpfPlayground
+{
+ public enum AccentColor
+ {
+ Green,
+ Yellow,
+ Blue,
+ Purple
+ }
+}
\ No newline at end of file
diff --git a/App/App.xaml.cs b/App/App.xaml.cs
index 0ffe5e5..d45232b 100644
--- a/App/App.xaml.cs
+++ b/App/App.xaml.cs
@@ -1,4 +1,6 @@
using System.Windows;
+using System.Windows.Media;
+using ModernWpf;
using Prism.Ioc;
namespace ModernWpfPlayground
@@ -8,6 +10,13 @@ namespace ModernWpfPlayground
///
public partial class App
{
+ ///
+ protected override void OnStartup(StartupEventArgs e)
+ {
+ ThemeManager.Current.AccentColor = Color.FromArgb(255, 0, 86, 76);
+ base.OnStartup(e);
+ }
+
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.Register();
diff --git a/App/MainWindow.xaml b/App/MainWindow.xaml
index 04b64d2..e458782 100644
--- a/App/MainWindow.xaml
+++ b/App/MainWindow.xaml
@@ -120,7 +120,7 @@
-
-
-
+ Margin="5"
+ Orientation="Vertical"
+ Spacing="5">
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/App/MainWindowViewModel.cs b/App/MainWindowViewModel.cs
index 908c801..4570b53 100644
--- a/App/MainWindowViewModel.cs
+++ b/App/MainWindowViewModel.cs
@@ -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);
diff --git a/Controls/PropertyPresenter/PropertyPresenter.xaml b/Controls/PropertyPresenter/PropertyPresenter.xaml
index 03f6276..d4cd0ea 100644
--- a/Controls/PropertyPresenter/PropertyPresenter.xaml
+++ b/Controls/PropertyPresenter/PropertyPresenter.xaml
@@ -92,7 +92,7 @@
DisplayMemberPath="Key"
ItemsSource="{Binding Value, ElementName=LayoutRoot, Converter={StaticResource EnumToKeyValuePairConverter}}"
SelectedValue="{Binding Value, ElementName=LayoutRoot}"
- SelectedValuePath="Value"
+ SelectedValuePath="Value" HorizontalAlignment="Stretch"
Validation.ErrorTemplate="{DynamicResource ValidationErrorTemplate}"
Validation.ValidationAdornerSiteFor="{Binding ElementName=LayoutRoot}">