From 928d16b5721e90c360718d52f86433dcb0a96ae8 Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Mon, 20 Nov 2023 21:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet.ModMaker/SimpleObservable/ObservableValue.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue.cs b/VPet.ModMaker/SimpleObservable/ObservableValue.cs index d86be23..9fd2d4a 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableValue.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableValue.cs @@ -77,10 +77,10 @@ public class ObservableValue private bool NotifyPropertyChanging(T oldValue, T newValue) { PropertyChanging?.Invoke(this, new(nameof(Value))); - var cancel = false; // 若全部事件取消改变 则取消改变 - ValueChanging?.Invoke(this, new(oldValue, newValue)); - return cancel; + var args = new ValueChangingEventArgs(oldValue, newValue); + ValueChanging?.Invoke(this, args); + return args.Cancel; } ///