重构Win32Natives

This commit is contained in:
ww-rm
2025-11-08 19:17:09 +08:00
parent fb319e09d8
commit 8e771fbaa4
19 changed files with 91 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
using SpineViewer.Natives;
using SpineViewer.Extensions;
using SpineViewer.Resources;
using SpineViewer.Services;
using SpineViewer.ViewModels.Exporters;
@@ -16,6 +16,7 @@ using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Win32Natives;
namespace SpineViewer.Views
{
@@ -32,9 +33,8 @@ namespace SpineViewer.Views
private void PreferenceDialog_SourceInitialized(object? sender, EventArgs e)
{
var hwnd = new WindowInteropHelper(this).Handle;
Dwmapi.SetWindowTextColor(hwnd, AppResource.Color_PrimaryText);
Dwmapi.SetWindowCaptionColor(hwnd, AppResource.Color_Region);
this.SetWindowTextColor(AppResource.Color_PrimaryText);
this.SetWindowCaptionColor(AppResource.Color_Region);
}
private void ButtonOK_Click(object sender, RoutedEventArgs e)