diff --git a/src/MicaWPF.Core/Controls/MicaWindow/MicaWindowInteropHandler.cs b/src/MicaWPF.Core/Controls/MicaWindow/MicaWindowInteropHandler.cs index f62ef30..8bf581e 100644 --- a/src/MicaWPF.Core/Controls/MicaWindow/MicaWindowInteropHandler.cs +++ b/src/MicaWPF.Core/Controls/MicaWindow/MicaWindowInteropHandler.cs @@ -2,7 +2,6 @@ // This software is distributed under the MIT license and its code is open-source and free for use, modification, and distribution. // -using System.Diagnostics; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Automation.Peers; @@ -12,7 +11,6 @@ using MicaWPF.Core.Enums; using MicaWPF.Core.Helpers; using MicaWPF.Core.Interop; -using MicaWPF.Core.Services; namespace MicaWPF.Core.Controls.MicaWindow; @@ -30,9 +28,15 @@ public MicaWindowInteropHandler() { } - protected System.Windows.Controls.Button? ButtonMax { get; set; } + protected System.Windows.Controls.Button? ButtonMax + { + get; set; + } - protected System.Windows.Controls.Button? ButtonRestore { get; set; } + protected System.Windows.Controls.Button? ButtonRestore + { + get; set; + } protected override void OnInitialized(EventArgs e) { @@ -79,7 +83,7 @@ private nint ShowSnapLayout(nint lparam, ref bool handled) handled = rect.Contains(point); if (handled) { - var color = TryFindResource($"MicaWPF{MicaWPFServiceUtility.BrushNamespace}.GradientBrushes.ControlElevationBorder") as LinearGradientBrush ?? new LinearGradientBrush(); + var color = TryFindResource($"MicaWPF.GradientBrushes.ControlElevationBorder") as LinearGradientBrush ?? new LinearGradientBrush(); button.Background = color; } else diff --git a/src/MicaWPF.Core/Services/AccentColorService.cs b/src/MicaWPF.Core/Services/AccentColorService.cs index 9b8589b..8cfb5cf 100644 --- a/src/MicaWPF.Core/Services/AccentColorService.cs +++ b/src/MicaWPF.Core/Services/AccentColorService.cs @@ -82,7 +82,7 @@ private void UpdateColorResources(Color primaryAccent, Color secondaryAccent, Co for (var i = 0; i < _colorKeys.Length; i++) { - Application.Current.Resources[$"MicaWPF{MicaWPFServiceUtility.BrushNamespace}.Colors.SystemAccentColor{_colorKeys[i]}"] = accentColors[i]; + Application.Current.Resources[$"MicaWPF.Colors.SystemAccentColor{_colorKeys[i]}"] = accentColors[i]; } WindowHelper.RefreshAllWindowsContents(); diff --git a/src/MicaWPF.Core/Services/MicaWPFServiceUtility.cs b/src/MicaWPF.Core/Services/MicaWPFServiceUtility.cs index 2eb5c25..88b3046 100644 --- a/src/MicaWPF.Core/Services/MicaWPFServiceUtility.cs +++ b/src/MicaWPF.Core/Services/MicaWPFServiceUtility.cs @@ -33,7 +33,10 @@ static MicaWPFServiceUtility() } } - public static bool HasBeenInitialized { get; } + public static bool HasBeenInitialized + { + get; + } /// /// Gets or sets the Accent Color Service instance (WARNING: Sets should be done on application start). @@ -70,6 +73,4 @@ public static string CurrentNamespace get => _currentNamespace ?? throw new ArgumentNullException("Value is not initialized yet."); set => StaticHelper.Init(value, ref _currentNamespace); } - - public static string BrushNamespace => CurrentNamespace == "MicaWPF" ? string.Empty : $".{CurrentNamespace}"; }