From 9b1533b51cd13a89e40fbd5ca5db840a06509cc1 Mon Sep 17 00:00:00 2001 From: Space Time Date: Mon, 25 Nov 2024 18:54:27 +0800 Subject: [PATCH] =?UTF-8?q?1.1.3=20->=201.1.4=20=E7=AC=AC16=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Preses/GlobalPres.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Preses/GlobalPres.cs b/Preses/GlobalPres.cs index b185f27..3d53cdb 100644 --- a/Preses/GlobalPres.cs +++ b/Preses/GlobalPres.cs @@ -1,17 +1,13 @@ using System.Windows; using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Messaging; -using CommunityToolkit.Mvvm.Messaging.Messages; using MaterialDesignThemes.Wpf; using Sheas_Cealer.Utils; namespace Sheas_Cealer.Preses; -internal partial class GlobalPres : ObservableRecipient, IRecipient> +internal partial class GlobalPres : ObservableObject { - internal GlobalPres() => IsActive = true; - - [ObservableProperty, NotifyPropertyChangedRecipients] + [ObservableProperty] private static bool? isLightTheme = null; partial void OnIsLightThemeChanged(bool? value) { @@ -23,8 +19,4 @@ internal partial class GlobalPres : ObservableRecipient, IRecipient(T oldValue, T newValue, string? propertyName) => Messenger.Send(new PropertyChangedMessage(this, propertyName, oldValue!, newValue!)); - - public void Receive(PropertyChangedMessage message) => GetType().GetProperty(message.PropertyName!)!.SetValue(this, message.NewValue); } \ No newline at end of file