1.1.3 -> 1.1.4 第16次更新

This commit is contained in:
Space Time 2024-11-25 18:54:27 +08:00
parent 94581ee703
commit 9b1533b51c

View File

@ -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<PropertyChangedMessage<object>>
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<PropertyChan
BorderThemeSetter.SetBorderTheme(Application.Current.MainWindow, value);
}
protected override void Broadcast<T>(T oldValue, T newValue, string? propertyName) => Messenger.Send(new PropertyChangedMessage<object>(this, propertyName, oldValue!, newValue!));
public void Receive(PropertyChangedMessage<object> message) => GetType().GetProperty(message.PropertyName!)!.SetValue(this, message.NewValue);
}