From 1d4a0c47972bc7dc5279e15c942f9ee504ee428e Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Sun, 3 Dec 2023 23:24:35 +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/Models/EnumFlagsVM.cs | 7 +- VPet.ModMaker/Models/Expansions.cs | 18 ++- VPet.ModMaker/Models/I18nData.cs | 2 +- VPet.ModMaker/Models/I18nHelper.cs | 2 +- VPet.ModMaker/Models/I18nModel.cs | 2 +- VPet.ModMaker/Models/ModLoader.cs | 3 +- VPet.ModMaker/Models/ModMakeHistory.cs | 3 +- VPet.ModMaker/Models/ModMaker.cs | 3 +- VPet.ModMaker/Models/ModMakerInfo.cs | 5 + VPet.ModMaker/Models/ModModel/AnimeModel.cs | 3 +- .../Models/ModModel/AnimeTypeModel.cs | 7 +- .../Models/ModModel/ClickTextModel.cs | 3 +- .../Models/ModModel/FoodAnimeModel.cs | 2 +- .../Models/ModModel/FoodAnimeTypeModel.cs | 11 +- .../Models/ModModel/FoodLocationModel.cs | 2 +- VPet.ModMaker/Models/ModModel/FoodModel.cs | 3 +- VPet.ModMaker/Models/ModModel/ImageModel.cs | 3 +- VPet.ModMaker/Models/ModModel/LowTextModel.cs | 2 +- VPet.ModMaker/Models/ModModel/ModInfoModel.cs | 3 +- VPet.ModMaker/Models/ModModel/MoveModel.cs | 2 +- VPet.ModMaker/Models/ModModel/PetModel.cs | 3 +- .../Models/ModModel/SelectTextModel.cs | 3 +- VPet.ModMaker/Models/ModModel/WorkModel.cs | 2 +- VPet.ModMaker/Models/ObservableRange.cs | 4 +- VPet.ModMaker/Models/Utils.cs | 7 +- .../{ModMakerStyles.cs => NativeStyles.cs} | 4 +- ...gnTimeResources.xaml => NativeStyles.xaml} | 2 +- .../AsyncExecuteEventHandler.cs | 16 +++ .../ObservableCommand/ExecuteEventHandler.cs | 15 +++ .../NotifyReceivedEventHandler.cs | 11 ++ .../ObservableCommand.cs | 47 ++------ .../ObservableCommandT.cs | 50 +++----- .../NotifySenderPropertyChangedHandler.cs | 13 ++ .../{ => ObservableValue}/ObservableValue.cs | 111 +++--------------- .../ObservableValueGroup.cs | 4 +- .../ObservableValue/ValueChangedEventArgs.cs | 29 +++++ .../ValueChangedEventHandler.cs | 11 ++ .../ObservableValue/ValueChangingEventArgs.cs | 29 +++++ .../ValueChangingEventHandler.cs | 11 ++ VPet.ModMaker/VPet.ModMaker.csproj | 21 +++- .../ViewModels/ModEdit/AddCultureWindowVM.cs | 3 +- .../ModEdit/AnimeEdit/AnimeEditWindowVM.cs | 19 +-- .../ModEdit/AnimeEdit/AnimePageVM.cs | 9 +- .../AnimeEdit/FoodAnimeEditWindowVM.cs | 37 +++--- .../ClickTextEdit/ClickTextEditWindowVM.cs | 2 +- .../ModEdit/ClickTextEdit/ClickTextPageVM.cs | 9 +- .../ModEdit/FoodEdit/FoodEditWindowVM.cs | 9 +- .../ViewModels/ModEdit/FoodEdit/FoodPageVM.cs | 9 +- .../ModEdit/I18nEdit/I18nEditWindowVM.cs | 11 +- .../LowTextEdit/LowTextEditWindowVM.cs | 2 +- .../ModEdit/LowTextEdit/LowTextPageVM.cs | 9 +- .../ViewModels/ModEdit/ModEditWindowVM.cs | 21 ++-- .../ModEdit/MoveEdit/MoveEditWindowVM.cs | 7 +- .../ViewModels/ModEdit/MoveEdit/MovePageVM.cs | 9 +- .../ModEdit/PetEdit/PetEditWindowVM.cs | 7 +- .../ViewModels/ModEdit/PetEdit/PetPageVM.cs | 9 +- .../ModEdit/SaveTranslationModWindowVM.cs | 4 +- .../SelectTextEdit/SelectTextEditWindowVM.cs | 2 +- .../SelectTextEdit/SelectTextPageVM.cs | 9 +- .../ModEdit/WorkEdit/WorkEditWindowVM.cs | 7 +- .../ViewModels/ModEdit/WorkEdit/WorkPageVM.cs | 9 +- VPet.ModMaker/ViewModels/ModMakerWindowVM.cs | 11 +- .../Views/ModEdit/AddCultureWindow.xaml.cs | 2 +- .../ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs | 3 +- .../AnimeEdit/FoodAnimeEditWindow.xaml.cs | 3 +- .../AnimeEdit/SelectGraphTypeWindow.xaml.cs | 3 +- .../ModEdit/I18nEdit/I18nEditWindow.xaml.cs | 4 +- 67 files changed, 392 insertions(+), 316 deletions(-) rename VPet.ModMaker/{ModMakerStyles.cs => NativeStyles.cs} (71%) rename VPet.ModMaker/{Properties/DesignTimeResources.xaml => NativeStyles.xaml} (90%) create mode 100644 VPet.ModMaker/SimpleObservable/ObservableCommand/AsyncExecuteEventHandler.cs create mode 100644 VPet.ModMaker/SimpleObservable/ObservableCommand/ExecuteEventHandler.cs create mode 100644 VPet.ModMaker/SimpleObservable/ObservableCommand/NotifyReceivedEventHandler.cs rename VPet.ModMaker/SimpleObservable/{ => ObservableCommand}/ObservableCommand.cs (76%) rename VPet.ModMaker/SimpleObservable/{ => ObservableCommand}/ObservableCommandT.cs (66%) create mode 100644 VPet.ModMaker/SimpleObservable/ObservableValue/NotifySenderPropertyChangedHandler.cs rename VPet.ModMaker/SimpleObservable/{ => ObservableValue}/ObservableValue.cs (72%) rename VPet.ModMaker/SimpleObservable/{ => ObservableValue}/ObservableValueGroup.cs (97%) create mode 100644 VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventArgs.cs create mode 100644 VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventHandler.cs create mode 100644 VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventArgs.cs create mode 100644 VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventHandler.cs diff --git a/VPet.ModMaker/Models/EnumFlagsVM.cs b/VPet.ModMaker/Models/EnumFlagsVM.cs index 853f366..1499143 100644 --- a/VPet.ModMaker/Models/EnumFlagsVM.cs +++ b/VPet.ModMaker/Models/EnumFlagsVM.cs @@ -1,10 +1,11 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; +using System.Windows.Input; namespace VPet.ModMaker.Models; @@ -44,8 +45,8 @@ public class ObservableEnumFlags { if (Attribute.IsDefined(EnumType, typeof(FlagsAttribute)) is false) throw new Exception("此枚举类型未使用特性 [Flags]"); - AddCommand.ExecuteEvent += AddCommand_ExecuteEvent; - RemoveCommand.ExecuteEvent += RemoveCommand_ExecuteEvent; + AddCommand.ExecuteCommand += AddCommand_ExecuteEvent; + RemoveCommand.ExecuteCommand += RemoveCommand_ExecuteEvent; } public ObservableEnumFlags(T value) diff --git a/VPet.ModMaker/Models/Expansions.cs b/VPet.ModMaker/Models/Expansions.cs index d9aee7e..7a27670 100644 --- a/VPet.ModMaker/Models/Expansions.cs +++ b/VPet.ModMaker/Models/Expansions.cs @@ -15,7 +15,7 @@ using System.Windows.Media.Imaging; using VPet.ModMaker.Models.ModModel; using VPet_Simulator.Core; -namespace VPet.ModMaker.Models; +namespace HKW.Models; /// /// 拓展 @@ -275,12 +275,26 @@ public static class Extensions /// 值类型 /// 集合 /// 带有索引的枚举值 - public static IEnumerable> Enumerate(this IEnumerable collection) + public static IEnumerable> EnumerateIndex(this IEnumerable collection) { var index = 0; foreach (var item in collection) yield return new(index++, item); } + + public static void SetDataContext(this Window window) + where T : new() + { + window.DataContext = new T(); + window.Closed += (s, e) => + { + try + { + window.DataContext = null; + } + catch { } + }; + } } /// diff --git a/VPet.ModMaker/Models/I18nData.cs b/VPet.ModMaker/Models/I18nData.cs index 8d1c19d..84daf3b 100644 --- a/VPet.ModMaker/Models/I18nData.cs +++ b/VPet.ModMaker/Models/I18nData.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/I18nHelper.cs b/VPet.ModMaker/Models/I18nHelper.cs index e2fc724..eb23bdc 100644 --- a/VPet.ModMaker/Models/I18nHelper.cs +++ b/VPet.ModMaker/Models/I18nHelper.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/I18nModel.cs b/VPet.ModMaker/Models/I18nModel.cs index ec430fc..e680502 100644 --- a/VPet.ModMaker/Models/I18nModel.cs +++ b/VPet.ModMaker/Models/I18nModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Linq; diff --git a/VPet.ModMaker/Models/ModLoader.cs b/VPet.ModMaker/Models/ModLoader.cs index 289371f..c29f366 100644 --- a/VPet.ModMaker/Models/ModLoader.cs +++ b/VPet.ModMaker/Models/ModLoader.cs @@ -1,4 +1,5 @@ -using LinePutScript; +using HKW.Models; +using LinePutScript; using LinePutScript.Converter; using LinePutScript.Dictionary; using System; diff --git a/VPet.ModMaker/Models/ModMakeHistory.cs b/VPet.ModMaker/Models/ModMakeHistory.cs index 1e06102..16d986f 100644 --- a/VPet.ModMaker/Models/ModMakeHistory.cs +++ b/VPet.ModMaker/Models/ModMakeHistory.cs @@ -1,4 +1,5 @@ -using LinePutScript.Converter; +using HKW.Models; +using LinePutScript.Converter; using System; using System.Collections.Generic; using System.IO; diff --git a/VPet.ModMaker/Models/ModMaker.cs b/VPet.ModMaker/Models/ModMaker.cs index 95dabcc..f6b9f02 100644 --- a/VPet.ModMaker/Models/ModMaker.cs +++ b/VPet.ModMaker/Models/ModMaker.cs @@ -9,6 +9,7 @@ using System.Windows.Controls; using System.Windows; using VPet_Simulator.Windows.Interface; using VPet.ModMaker.Views; +using HKW.Models; namespace VPet.ModMaker.Models; @@ -37,7 +38,7 @@ public class ModMaker : MainPlugin Setting(); }; modset.Items.Add(menuset); - Application.Current.Resources.MergedDictionaries.Add(Utils.ModMakerStyles); + Application.Current.Resources.MergedDictionaries.Add(ModMakerInfo.NativeStyles); } public override void Setting() diff --git a/VPet.ModMaker/Models/ModMakerInfo.cs b/VPet.ModMaker/Models/ModMakerInfo.cs index 787adfa..856b7a6 100644 --- a/VPet.ModMaker/Models/ModMakerInfo.cs +++ b/VPet.ModMaker/Models/ModMakerInfo.cs @@ -36,4 +36,9 @@ public static class ModMakerInfo /// 本体的宠物 /// public static List Pets { get; } = new(); + + /// + /// 本地风格 + /// + public static NativeStyles NativeStyles { get; } = new(); } diff --git a/VPet.ModMaker/Models/ModModel/AnimeModel.cs b/VPet.ModMaker/Models/ModModel/AnimeModel.cs index 93d5d0c..e8ffbd7 100644 --- a/VPet.ModMaker/Models/ModModel/AnimeModel.cs +++ b/VPet.ModMaker/Models/ModModel/AnimeModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System.Collections.ObjectModel; using System.IO; using System.Linq; diff --git a/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs b/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs index 04ac45f..e5e662f 100644 --- a/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs +++ b/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -614,7 +615,7 @@ public class AnimeTypeModel static void SaveAnimes(string animePath, ObservableCollection animes) { Directory.CreateDirectory(animePath); - foreach (var anime in animes.Enumerate()) + foreach (var anime in animes.EnumerateIndex()) SaveImages(Path.Combine(animePath, anime.Index.ToString()), anime.Value); } } @@ -627,7 +628,7 @@ public class AnimeTypeModel static void SaveImages(string imagesPath, AnimeModel model) { Directory.CreateDirectory(imagesPath); - foreach (var image in model.Images.Enumerate()) + foreach (var image in model.Images.EnumerateIndex()) { image.Value.Image.Value.SaveToPng( Path.Combine( diff --git a/VPet.ModMaker/Models/ModModel/ClickTextModel.cs b/VPet.ModMaker/Models/ModModel/ClickTextModel.cs index 2976583..6689956 100644 --- a/VPet.ModMaker/Models/ModModel/ClickTextModel.cs +++ b/VPet.ModMaker/Models/ModModel/ClickTextModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Converter; using System; using System.Collections.Generic; diff --git a/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs b/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs index 6436977..655f394 100644 --- a/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using LinePutScript; using System; using System.Collections.Generic; diff --git a/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs b/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs index 27e0ffc..5335189 100644 --- a/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript; using LinePutScript.Localization.WPF; using System; @@ -304,7 +305,7 @@ public class FoodAnimeTypeModel ) { var modeAnimePath = Path.Combine(animePath, mode.ToString()); - foreach (var anime in animes.Enumerate()) + foreach (var anime in animes.EnumerateIndex()) { var indexPath = Path.Combine(modeAnimePath, anime.Index.ToString()); Directory.CreateDirectory(indexPath); @@ -329,7 +330,7 @@ public class FoodAnimeTypeModel var backLayPath = Path.Combine(indexPath, BackLayName); Directory.CreateDirectory(frontLayPath); Directory.CreateDirectory(backLayPath); - foreach (var frontImage in anime.FrontImages.Enumerate()) + foreach (var frontImage in anime.FrontImages.EnumerateIndex()) { frontImage.Value.Image.Value.SaveToPng( Path.Combine( @@ -338,7 +339,7 @@ public class FoodAnimeTypeModel ) ); } - foreach (var backImage in anime.BackImages.Enumerate()) + foreach (var backImage in anime.BackImages.EnumerateIndex()) { backImage.Value.Image.Value.SaveToPng( Path.Combine( @@ -377,7 +378,7 @@ public class FoodAnimeTypeModel new Sub("mode", mode.ToString()), new Sub("graph", Name.Value) }; - foreach (var foodLocation in anime.FoodLocations.Enumerate()) + foreach (var foodLocation in anime.FoodLocations.EnumerateIndex()) { var sub = new Sub($"a{foodLocation.Index}"); sub.info = foodLocation.Value.ToString(); diff --git a/VPet.ModMaker/Models/ModModel/FoodLocationModel.cs b/VPet.ModMaker/Models/ModModel/FoodLocationModel.cs index 3d7ade2..42f18f0 100644 --- a/VPet.ModMaker/Models/ModModel/FoodLocationModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodLocationModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Linq; diff --git a/VPet.ModMaker/Models/ModModel/FoodModel.cs b/VPet.ModMaker/Models/ModModel/FoodModel.cs index d25b140..47216de 100644 --- a/VPet.ModMaker/Models/ModModel/FoodModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript; using LinePutScript.Converter; using System; diff --git a/VPet.ModMaker/Models/ModModel/ImageModel.cs b/VPet.ModMaker/Models/ModModel/ImageModel.cs index d44a9de..dcf572b 100644 --- a/VPet.ModMaker/Models/ModModel/ImageModel.cs +++ b/VPet.ModMaker/Models/ModModel/ImageModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System; using System.Collections.Generic; using System.Linq; diff --git a/VPet.ModMaker/Models/ModModel/LowTextModel.cs b/VPet.ModMaker/Models/ModModel/LowTextModel.cs index e54d306..dd29140 100644 --- a/VPet.ModMaker/Models/ModModel/LowTextModel.cs +++ b/VPet.ModMaker/Models/ModModel/LowTextModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/ModModel/ModInfoModel.cs b/VPet.ModMaker/Models/ModModel/ModInfoModel.cs index 207014e..2f214f8 100644 --- a/VPet.ModMaker/Models/ModModel/ModInfoModel.cs +++ b/VPet.ModMaker/Models/ModModel/ModInfoModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript; using LinePutScript.Converter; using LinePutScript.Localization.WPF; diff --git a/VPet.ModMaker/Models/ModModel/MoveModel.cs b/VPet.ModMaker/Models/ModModel/MoveModel.cs index 35a04bc..ad359a3 100644 --- a/VPet.ModMaker/Models/ModModel/MoveModel.cs +++ b/VPet.ModMaker/Models/ModModel/MoveModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/ModModel/PetModel.cs b/VPet.ModMaker/Models/ModModel/PetModel.cs index 2134e01..a98e1c4 100644 --- a/VPet.ModMaker/Models/ModModel/PetModel.cs +++ b/VPet.ModMaker/Models/ModModel/PetModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript; using LinePutScript.Converter; using LinePutScript.Localization.WPF; diff --git a/VPet.ModMaker/Models/ModModel/SelectTextModel.cs b/VPet.ModMaker/Models/ModModel/SelectTextModel.cs index be54d37..96ba63f 100644 --- a/VPet.ModMaker/Models/ModModel/SelectTextModel.cs +++ b/VPet.ModMaker/Models/ModModel/SelectTextModel.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/ModModel/WorkModel.cs b/VPet.ModMaker/Models/ModModel/WorkModel.cs index 71c20cd..0f23495 100644 --- a/VPet.ModMaker/Models/ModModel/WorkModel.cs +++ b/VPet.ModMaker/Models/ModModel/WorkModel.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Models/ObservableRange.cs b/VPet.ModMaker/Models/ObservableRange.cs index a712bd6..62d9f18 100644 --- a/VPet.ModMaker/Models/ObservableRange.cs +++ b/VPet.ModMaker/Models/ObservableRange.cs @@ -1,6 +1,6 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; -namespace VPet.ModMaker.Models; +namespace HKW.Models; /// /// 可观察的范围 diff --git a/VPet.ModMaker/Models/Utils.cs b/VPet.ModMaker/Models/Utils.cs index 8c4575c..1d348a2 100644 --- a/VPet.ModMaker/Models/Utils.cs +++ b/VPet.ModMaker/Models/Utils.cs @@ -4,11 +4,10 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; -using System.Windows; using System.Windows.Media.Imaging; +using VPet.ModMaker; -namespace VPet.ModMaker.Models; +namespace HKW.Models; /// /// 工具 @@ -26,8 +25,6 @@ public static class Utils public const int DecodePixelHeight = 250; public static char[] Separator { get; } = new char[] { '_' }; - public static ModMakerStyles ModMakerStyles { get; } = new ModMakerStyles(); - //public static BitmapImage LoadImageToStream(string imagePath) //{ // BitmapImage bitmapImage = new(); diff --git a/VPet.ModMaker/ModMakerStyles.cs b/VPet.ModMaker/NativeStyles.cs similarity index 71% rename from VPet.ModMaker/ModMakerStyles.cs rename to VPet.ModMaker/NativeStyles.cs index 314fbdc..46f2e21 100644 --- a/VPet.ModMaker/ModMakerStyles.cs +++ b/VPet.ModMaker/NativeStyles.cs @@ -7,9 +7,9 @@ using System.Windows; namespace VPet.ModMaker; -public partial class ModMakerStyles : ResourceDictionary +public partial class NativeStyles : ResourceDictionary { - public ModMakerStyles() + public NativeStyles() { InitializeComponent(); } diff --git a/VPet.ModMaker/Properties/DesignTimeResources.xaml b/VPet.ModMaker/NativeStyles.xaml similarity index 90% rename from VPet.ModMaker/Properties/DesignTimeResources.xaml rename to VPet.ModMaker/NativeStyles.xaml index 6ffe8bc..ebcc9c0 100644 --- a/VPet.ModMaker/Properties/DesignTimeResources.xaml +++ b/VPet.ModMaker/NativeStyles.xaml @@ -1,5 +1,5 @@  diff --git a/VPet.ModMaker/SimpleObservable/ObservableCommand/AsyncExecuteEventHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableCommand/AsyncExecuteEventHandler.cs new file mode 100644 index 0000000..cf0818a --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableCommand/AsyncExecuteEventHandler.cs @@ -0,0 +1,16 @@ +using System; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace HKW.HKWUtils.Observable; + +/// +/// 异步执行命令事件 +/// +public delegate Task AsyncExecuteEventHandler(); + +/// +/// 异步执行命令事件 +/// +/// 值 +public delegate Task AsyncExecuteEventHandler(T parameter); diff --git a/VPet.ModMaker/SimpleObservable/ObservableCommand/ExecuteEventHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableCommand/ExecuteEventHandler.cs new file mode 100644 index 0000000..1f54d08 --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableCommand/ExecuteEventHandler.cs @@ -0,0 +1,15 @@ +using System; +using System.Windows.Input; + +namespace HKW.HKWUtils.Observable; + +/// +/// 执行事件 +/// +public delegate void ExecuteEventHandler(); + +/// +/// 执行事件 +/// +/// 参数 +public delegate void ExecuteEventHandler(T parameter); diff --git a/VPet.ModMaker/SimpleObservable/ObservableCommand/NotifyReceivedEventHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableCommand/NotifyReceivedEventHandler.cs new file mode 100644 index 0000000..ba2a50e --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableCommand/NotifyReceivedEventHandler.cs @@ -0,0 +1,11 @@ +using System.ComponentModel; +using System.Windows.Input; + +namespace HKW.HKWUtils.Observable; + +/// +/// 通知接收器 +/// +/// 发送者 +/// 参数 +public delegate void NotifyReceivedEventHandler(ICommand sender, CancelEventArgs e); diff --git a/VPet.ModMaker/SimpleObservable/ObservableCommand.cs b/VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommand.cs similarity index 76% rename from VPet.ModMaker/SimpleObservable/ObservableCommand.cs rename to VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommand.cs index 50a91f2..3899e1f 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableCommand.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommand.cs @@ -1,20 +1,16 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows.Input; -namespace HKW.HKWViewModels.SimpleObservable; +namespace HKW.HKWUtils.Observable; /// /// 可观察命令 /// -[DebuggerDisplay( - "CanExecute = {CanExecuteProperty.Value}, EventCount = {ExecuteEvent.GetInvocationList().Length}, AsyncEventCount = {AsyncExecuteEvent.GetInvocationList().Length}" -)] +[DebuggerDisplay("\\{ObservableCommand, CanExecute = {CanExecuteProperty.Value}\\}")] public class ObservableCommand : ICommand { /// @@ -68,7 +64,7 @@ public class ObservableCommand : ICommand /// 参数 public async void Execute(object? parameter) { - ExecuteEvent?.Invoke(); + ExecuteCommand?.Invoke(); await ExecuteAsync(); } @@ -78,11 +74,13 @@ public class ObservableCommand : ICommand /// 等待 private async Task ExecuteAsync() { - if (AsyncExecuteEvent is null) + if (AsyncExecuteCommand is null) return; CurrentCanExecute.Value = false; foreach ( - var asyncEvent in AsyncExecuteEvent.GetInvocationList().Cast() + var asyncEvent in AsyncExecuteCommand + .GetInvocationList() + .Cast() ) await asyncEvent.Invoke(); CurrentCanExecute.Value = true; @@ -128,9 +126,9 @@ public class ObservableCommand : ICommand private void Notify_PropertyChanged(object? sender, PropertyChangedEventArgs e) { - var temp = CanExecuteProperty.Value; - NotifyCanExecuteReceived?.Invoke(ref temp); - CanExecuteProperty.Value = temp; + var args = new CancelEventArgs(); + NotifyCanExecuteReceived?.Invoke(this, args); + CanExecuteProperty.Value = args.Cancel; } #endregion @@ -143,35 +141,16 @@ public class ObservableCommand : ICommand /// /// 执行事件 /// - public event ExecuteHandler? ExecuteEvent; + public event ExecuteEventHandler? ExecuteCommand; /// /// 异步执行事件 /// - public event AsyncExecuteHandler? AsyncExecuteEvent; + public event AsyncExecuteEventHandler? AsyncExecuteCommand; /// /// 可执行通知接收器事件 /// - public event NotifyReceivedHandler? NotifyCanExecuteReceived; - #endregion - - #region Delegate - /// - /// 执行 - /// - public delegate void ExecuteHandler(); - - /// - /// 异步执行 - /// - /// - public delegate Task AsyncExecuteHandler(); - - /// - /// 通知接收器 - /// - /// 引用值 - public delegate void NotifyReceivedHandler(ref bool value); + public event NotifyReceivedEventHandler? NotifyCanExecuteReceived; #endregion } diff --git a/VPet.ModMaker/SimpleObservable/ObservableCommandT.cs b/VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommandT.cs similarity index 66% rename from VPet.ModMaker/SimpleObservable/ObservableCommandT.cs rename to VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommandT.cs index db560c2..759f6d1 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableCommandT.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableCommand/ObservableCommandT.cs @@ -1,21 +1,17 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; -using System.Text; using System.Threading.Tasks; using System.Windows.Input; -namespace HKW.HKWViewModels.SimpleObservable; +namespace HKW.HKWUtils.Observable; /// /// 带参数的可观察命令 /// /// 参数类型 -[DebuggerDisplay( - "CanExecute = {CanExecuteProperty.Value}, EventCount = {ExecuteEvent.GetInvocationList().Length}, AsyncEventCount = {AsyncExecuteEvent.GetInvocationList().Length}" -)] +[DebuggerDisplay("\\{ObservableCommand, CanExecute = {CanExecuteProperty.Value}\\}")] public class ObservableCommand : ICommand where T : notnull { @@ -61,19 +57,21 @@ public class ObservableCommand : ICommand /// public async void Execute(object? parameter) { - ExecuteEvent?.Invoke((T?)parameter!); - await ExecuteAsync((T?)parameter!); + ExecuteCommand?.Invoke((T)parameter!); + await ExecuteAsync((T)parameter!); } /// /// 参数 private async Task ExecuteAsync(T parameter) { - if (AsyncExecuteEvent is null) + if (AsyncExecuteCommand is null) return; CurrentCanExecute.Value = false; foreach ( - var asyncEvent in AsyncExecuteEvent.GetInvocationList().Cast() + var asyncEvent in AsyncExecuteCommand + .GetInvocationList() + .Cast>() ) await asyncEvent.Invoke(parameter); CurrentCanExecute.Value = true; @@ -97,9 +95,9 @@ public class ObservableCommand : ICommand private void Notify_PropertyChanged(object? sender, PropertyChangedEventArgs e) { - var temp = CanExecuteProperty.Value; - NotifyCanExecuteReceived?.Invoke(ref temp); - CanExecuteProperty.Value = temp; + var args = new CancelEventArgs(); + NotifyCanExecuteReceived?.Invoke(this, args); + CanExecuteProperty.Value = args.Cancel; } #endregion @@ -107,29 +105,13 @@ public class ObservableCommand : ICommand /// public event EventHandler? CanExecuteChanged; - /// - public event ExecuteHandler? ExecuteEvent; + /// + public event ExecuteEventHandler? ExecuteCommand; - /// - public event AsyncExecuteHandler? AsyncExecuteEvent; + /// + public event AsyncExecuteEventHandler? AsyncExecuteCommand; /// - public event NotifyReceivedHandler? NotifyCanExecuteReceived; - #endregion - - #region Delegate - /// - /// 值 - public delegate void ExecuteHandler(T value); - - /// - /// 值 - public delegate Task AsyncExecuteHandler(T value); - - /// - /// 通知接收器 - /// - /// 引用值 - public delegate void NotifyReceivedHandler(ref bool value); + public event NotifyReceivedEventHandler? NotifyCanExecuteReceived; #endregion } diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/NotifySenderPropertyChangedHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/NotifySenderPropertyChangedHandler.cs new file mode 100644 index 0000000..824eb7a --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/NotifySenderPropertyChangedHandler.cs @@ -0,0 +1,13 @@ +using System.ComponentModel; + +namespace HKW.HKWUtils.Observable; + +/// +/// 通知发送者属性改变接收器 +/// +/// 发送者 +/// 属性改变事件发送者 +public delegate void NotifySenderPropertyChangedHandler( + ObservableValue sender, + INotifyPropertyChanged? eventSender +); diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValue.cs similarity index 72% rename from VPet.ModMaker/SimpleObservable/ObservableValue.cs rename to VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValue.cs index 9fd2d4a..f3a3a3f 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableValue.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValue.cs @@ -1,13 +1,9 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace HKW.HKWViewModels.SimpleObservable; +namespace HKW.HKWUtils.Observable; /// /// 可观察值 @@ -77,9 +73,11 @@ public class ObservableValue private bool NotifyPropertyChanging(T oldValue, T newValue) { PropertyChanging?.Invoke(this, new(nameof(Value))); - // 若全部事件取消改变 则取消改变 var args = new ValueChangingEventArgs(oldValue, newValue); ValueChanging?.Invoke(this, args); + // 取消改变后通知UI更改 + if (args.Cancel) + PropertyChanged?.Invoke(this, new(nameof(Value))); return args.Cancel; } @@ -188,6 +186,16 @@ public class ObservableValue return Guid.Equals(other?.Guid) is true; } + /// + /// 值相等 + /// + /// 其它可观察值 + /// 相等为 否则为 + public bool ValueEquals(ObservableValue other) + { + return Value?.Equals(other.Value) is true; + } + /// /// 判断 相等 /// @@ -227,101 +235,16 @@ public class ObservableValue /// /// 值改变前事件 /// - public event ValueChangingEventHandler? ValueChanging; + public event ValueChangingEventHandler? ValueChanging; /// /// 值改变后事件 /// - public event ValueChangedEventHandler? ValueChanged; + public event ValueChangedEventHandler? ValueChanged; /// /// 通知接收事件 /// - public event NotifySenderPropertyChangedHandler? SenderPropertyChanged; - - #endregion - - #region Delegate - /// - /// 值改变前事件 - /// - /// 发送者 - /// 参数 - public delegate void ValueChangingEventHandler( - ObservableValue sender, - ValueChangingEventArgs e - ); - - /// - /// 值改变后事件 - /// - /// 发送者 - /// 参数 - public delegate void ValueChangedEventHandler( - ObservableValue sender, - ValueChangedEventArgs e - ); - - /// - /// 通知发送者属性改变接收器 - /// - /// 源 - /// 发送者 - public delegate void NotifySenderPropertyChangedHandler( - ObservableValue source, - INotifyPropertyChanged? sender - ); + public event NotifySenderPropertyChangedHandler? SenderPropertyChanged; #endregion } - -/// -/// 值改变前事件参数 -/// -/// 值类型 -public class ValueChangingEventArgs : CancelEventArgs -{ - /// - /// 旧值 - /// - public T? OldValue { get; } - - /// - /// 新值 - /// - public T? NewValue { get; } - - /// - /// 旧值 - /// 新值 - public ValueChangingEventArgs(T? oldValue, T? newValue) - { - OldValue = oldValue; - NewValue = newValue; - } -} - -/// -/// 值改变后事件参数 -/// -/// 值类型 -public class ValueChangedEventArgs : EventArgs -{ - /// - /// 旧值 - /// - public T OldValue { get; } - - /// - /// 新值 - /// - public T NewValue { get; } - - /// - /// 旧值 - /// 新值 - public ValueChangedEventArgs(T oldValue, T newValue) - { - OldValue = oldValue; - NewValue = newValue; - } -} diff --git a/VPet.ModMaker/SimpleObservable/ObservableValueGroup.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs similarity index 97% rename from VPet.ModMaker/SimpleObservable/ObservableValueGroup.cs rename to VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs index 11bbca4..3a06b53 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableValueGroup.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs @@ -4,10 +4,8 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace HKW.HKWViewModels.SimpleObservable; +namespace HKW.HKWUtils.Observable; /// /// 可观察值组合 diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventArgs.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventArgs.cs new file mode 100644 index 0000000..f3f6d3e --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventArgs.cs @@ -0,0 +1,29 @@ +using System; + +namespace HKW.HKWUtils.Observable; + +/// +/// 值改变后事件参数 +/// +/// 值类型 +public class ValueChangedEventArgs : EventArgs +{ + /// + /// 旧值 + /// + public T? OldValue { get; } + + /// + /// 新值 + /// + public T? NewValue { get; } + + /// + /// 旧值 + /// 新值 + public ValueChangedEventArgs(T oldValue, T newValue) + { + OldValue = oldValue; + NewValue = newValue; + } +} diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventHandler.cs new file mode 100644 index 0000000..95ff1b0 --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangedEventHandler.cs @@ -0,0 +1,11 @@ +namespace HKW.HKWUtils.Observable; + +/// +/// 值改变后事件 +/// +/// 发送者 +/// 参数 +public delegate void ValueChangedEventHandler( + ObservableValue sender, + ValueChangedEventArgs e +); diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventArgs.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventArgs.cs new file mode 100644 index 0000000..5b0f93f --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventArgs.cs @@ -0,0 +1,29 @@ +using System.ComponentModel; + +namespace HKW.HKWUtils.Observable; + +/// +/// 值改变前事件参数 +/// +/// 值类型 +public class ValueChangingEventArgs : CancelEventArgs +{ + /// + /// 旧值 + /// + public T? OldValue { get; } + + /// + /// 新值 + /// + public T? NewValue { get; } + + /// + /// 旧值 + /// 新值 + public ValueChangingEventArgs(T? oldValue, T? newValue) + { + OldValue = oldValue; + NewValue = newValue; + } +} diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventHandler.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventHandler.cs new file mode 100644 index 0000000..5ee9aa1 --- /dev/null +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ValueChangingEventHandler.cs @@ -0,0 +1,11 @@ +namespace HKW.HKWUtils.Observable; + +/// +/// 值改变前事件 +/// +/// 发送者 +/// 参数 +public delegate void ValueChangingEventHandler( + ObservableValue sender, + ValueChangingEventArgs e +); diff --git a/VPet.ModMaker/VPet.ModMaker.csproj b/VPet.ModMaker/VPet.ModMaker.csproj index 3420104..1aac115 100644 --- a/VPet.ModMaker/VPet.ModMaker.csproj +++ b/VPet.ModMaker/VPet.ModMaker.csproj @@ -133,9 +133,19 @@ - - - + + + + + + + + + + + + + @@ -205,8 +215,6 @@ Settings.settings True - - FoodEditWindow.xaml @@ -260,7 +268,7 @@ Designer MSBuild:Compile - + MSBuild:Compile Designer true @@ -385,5 +393,6 @@ + \ No newline at end of file diff --git a/VPet.ModMaker/ViewModels/ModEdit/AddCultureWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AddCultureWindowVM.cs index d3b79d7..6728e05 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AddCultureWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AddCultureWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; diff --git a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs index e08ff0c..155d4e6 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -122,14 +123,14 @@ public class AnimeEditWindowVM CurrentAnimeModel.ValueChanged += CurrentAnimeModel_ValueChanged; - PlayCommand.AsyncExecuteEvent += PlayCommand_AsyncExecuteEvent; - StopCommand.ExecuteEvent += StopCommand_ExecuteEvent; - AddAnimeCommand.ExecuteEvent += AddAnimeCommand_ExecuteEvent; - RemoveAnimeCommand.ExecuteEvent += RemoveAnimeCommand_ExecuteEvent; - AddImageCommand.ExecuteEvent += AddImageCommand_ExecuteEvent; - RemoveImageCommand.ExecuteEvent += RemoveImageCommand_ExecuteEvent; - ChangeImageCommand.ExecuteEvent += ChangeImageCommand_ExecuteEvent; - ClearImageCommand.ExecuteEvent += ClearImageCommand_ExecuteEvent; + PlayCommand.AsyncExecuteCommand += PlayCommand_AsyncExecuteEvent; + StopCommand.ExecuteCommand += StopCommand_ExecuteEvent; + AddAnimeCommand.ExecuteCommand += AddAnimeCommand_ExecuteEvent; + RemoveAnimeCommand.ExecuteCommand += RemoveAnimeCommand_ExecuteEvent; + AddImageCommand.ExecuteCommand += AddImageCommand_ExecuteEvent; + RemoveImageCommand.ExecuteCommand += RemoveImageCommand_ExecuteEvent; + ChangeImageCommand.ExecuteCommand += ChangeImageCommand_ExecuteEvent; + ClearImageCommand.ExecuteCommand += ClearImageCommand_ExecuteEvent; Anime.ValueChanged += Anime_ValueChanged; } diff --git a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimePageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimePageVM.cs index 206c767..8978e2b 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimePageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimePageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Panuon.WPF.UI; using System; @@ -75,9 +76,9 @@ public class AnimePageVM CurrentPet.ValueChanged += CurrentPet_ValueChanged; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void InitializeAllAnimes() diff --git a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs index fba1d4f..5dc58d4 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -210,27 +211,27 @@ public class FoodAnimeEditWindowVM CurrentAnimeModel.ValueChanged += CurrentAnimeModel_ValueChanged; - PlayCommand.AsyncExecuteEvent += PlayCommand_AsyncExecuteEvent; - StopCommand.ExecuteEvent += StopCommand_ExecuteEvent; - ReplaceFoodImageCommand.ExecuteEvent += ChangeFoodImageCommand_ExecuteEvent; - ResetFoodImageCommand.ExecuteEvent += ResetFoodImageCommand_ExecuteEvent; + PlayCommand.AsyncExecuteCommand += PlayCommand_AsyncExecuteEvent; + StopCommand.ExecuteCommand += StopCommand_ExecuteEvent; + ReplaceFoodImageCommand.ExecuteCommand += ChangeFoodImageCommand_ExecuteEvent; + ResetFoodImageCommand.ExecuteCommand += ResetFoodImageCommand_ExecuteEvent; - AddAnimeCommand.ExecuteEvent += AddAnimeCommand_ExecuteEvent; - RemoveAnimeCommand.ExecuteEvent += RemoveAnimeCommand_ExecuteEvent; + AddAnimeCommand.ExecuteCommand += AddAnimeCommand_ExecuteEvent; + RemoveAnimeCommand.ExecuteCommand += RemoveAnimeCommand_ExecuteEvent; - AddFrontImageCommand.ExecuteEvent += AddFrontImageCommand_ExecuteEvent; - RemoveFrontImageCommand.ExecuteEvent += RemoveFrontImageCommand_ExecuteEvent; - ClearFrontImageCommand.ExecuteEvent += ClearFrontImageCommand_ExecuteEvent; - ChangeFrontImageCommand.ExecuteEvent += ChangeFrontImageCommand_ExecuteEvent; + AddFrontImageCommand.ExecuteCommand += AddFrontImageCommand_ExecuteEvent; + RemoveFrontImageCommand.ExecuteCommand += RemoveFrontImageCommand_ExecuteEvent; + ClearFrontImageCommand.ExecuteCommand += ClearFrontImageCommand_ExecuteEvent; + ChangeFrontImageCommand.ExecuteCommand += ChangeFrontImageCommand_ExecuteEvent; - AddBackImageCommand.ExecuteEvent += AddBackImageCommand_ExecuteEvent; - RemoveBackImageCommand.ExecuteEvent += RemoveBackImageCommand_ExecuteEvent; - ClearBackImageCommand.ExecuteEvent += ClearBackImageCommand_ExecuteEvent; - ChangeBackImageCommand.ExecuteEvent += ChangeBackImageCommand_ExecuteEvent; + AddBackImageCommand.ExecuteCommand += AddBackImageCommand_ExecuteEvent; + RemoveBackImageCommand.ExecuteCommand += RemoveBackImageCommand_ExecuteEvent; + ClearBackImageCommand.ExecuteCommand += ClearBackImageCommand_ExecuteEvent; + ChangeBackImageCommand.ExecuteCommand += ChangeBackImageCommand_ExecuteEvent; - AddFoodLocationCommand.ExecuteEvent += AddeFoodLocationCommand_ExecuteEvent; - RemoveFoodLocationCommand.ExecuteEvent += RemoveFoodLocationCommand_ExecuteEvent; - ClearFoodLocationCommand.ExecuteEvent += ClearFoodLocationCommand_ExecuteEvent; + AddFoodLocationCommand.ExecuteCommand += AddeFoodLocationCommand_ExecuteEvent; + RemoveFoodLocationCommand.ExecuteCommand += RemoveFoodLocationCommand_ExecuteEvent; + ClearFoodLocationCommand.ExecuteCommand += ClearFoodLocationCommand_ExecuteEvent; } private void ResetFoodImageCommand_ExecuteEvent() diff --git a/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextEditWindowVM.cs index e2f8d46..27675f5 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextEditWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextPageVM.cs index b64bf68..dc64171 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/ClickTextEdit/ClickTextPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -51,9 +52,9 @@ public class ClickTextPageVM { ShowClickTexts.Value = ClickTexts; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void Search_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs index 0b474fd..2bcbe21 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -32,10 +33,10 @@ public class FoodEditWindowVM public FoodEditWindowVM() { - AddImageCommand.ExecuteEvent += AddImage; - ChangeImageCommand.ExecuteEvent += ChangeImage; + AddImageCommand.ExecuteCommand += AddImage; + ChangeImageCommand.ExecuteCommand += ChangeImage; AutoSetReferencePrice.ValueChanged += AutoSetReferencePrice_ValueChanged; - SetReferencePriceCommand.ExecuteEvent += SetReferencePriceToPrice; + SetReferencePriceCommand.ExecuteCommand += SetReferencePriceToPrice; Food.Value.ReferencePrice.ValueChanged += ReferencePrice_ValueChanged; } diff --git a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodPageVM.cs index 5ac0175..2edd0d1 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -31,9 +32,9 @@ public class FoodPageVM ShowFoods.Value = Foods; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void Search_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/I18nEdit/I18nEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/I18nEdit/I18nEditWindowVM.cs index 930f034..92870a0 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/I18nEdit/I18nEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/I18nEdit/I18nEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -351,7 +352,7 @@ public class I18nEditWindowVM { if (AllI18nDatas.TryGetValue(id.Value, out var outData)) { - foreach (var culture in I18nHelper.Current.CultureNames.Enumerate()) + foreach (var culture in I18nHelper.Current.CultureNames.EnumerateIndex()) { if (outData.Datas[culture.Index].Group is null) { @@ -385,7 +386,7 @@ public class I18nEditWindowVM sourceData.Id.Group?.Remove(sourceData.Id); if (AllI18nDatas.TryGetValue(e.OldValue, out var outData)) { - foreach (var culture in I18nHelper.Current.CultureNames.Enumerate()) + foreach (var culture in I18nHelper.Current.CultureNames.EnumerateIndex()) { if (outData.Datas[culture.Index].Group is null) { @@ -417,7 +418,7 @@ public class I18nEditWindowVM where T : class, new() { var data = AllI18nDatas[id.Value]; - foreach (var culture in I18nHelper.Current.CultureNames.Enumerate()) + foreach (var culture in I18nHelper.Current.CultureNames.EnumerateIndex()) { if (data.Datas[culture.Index].Group is ObservableValueGroup group) { @@ -452,7 +453,7 @@ public class I18nEditWindowVM where T : class, new() { var data = AllI18nDatas[id.Value]; - foreach (var culture in I18nHelper.Current.CultureNames.Enumerate()) + foreach (var culture in I18nHelper.Current.CultureNames.EnumerateIndex()) { var oldValue = data.Datas[culture.Index]; var newValue = i18nValue(i18nModel.I18nDatas[culture.Value]); diff --git a/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextEditWindowVM.cs index c180d35..6dfd262 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextEditWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextPageVM.cs index 3622284..ee52062 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/LowTextEdit/LowTextPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -32,9 +33,9 @@ public class LowTextPageVM { ShowLowTexts.Value = LowTexts; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void Search_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs index c3135d7..2df879a 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using Microsoft.Win32; using System; using System.Collections.Generic; @@ -18,6 +18,7 @@ using Panuon.WPF.UI; using VPet.ModMaker.Views.ModEdit.I18nEdit; using System.Globalization; using Ookii.Dialogs.Wpf; +using HKW.Models; namespace VPet.ModMaker.ViewModels.ModEdit; @@ -89,16 +90,16 @@ public class ModEditWindowVM { new I18nEditWindow(); ModEditWindow = window; - ChangeImageCommand.ExecuteEvent += ChangeImage; - AddCultureCommand.ExecuteEvent += AddCulture; - EditCultureCommand.ExecuteEvent += EditCulture; - RemoveCultureCommand.ExecuteEvent += RemoveCulture; - EditI18nCommand.ExecuteEvent += EditI18n; - SetMainCultureCommand.ExecuteEvent += SetMainCulture; + ChangeImageCommand.ExecuteCommand += ChangeImage; + AddCultureCommand.ExecuteCommand += AddCulture; + EditCultureCommand.ExecuteCommand += EditCulture; + RemoveCultureCommand.ExecuteCommand += RemoveCulture; + EditI18nCommand.ExecuteCommand += EditI18n; + SetMainCultureCommand.ExecuteCommand += SetMainCulture; - SaveCommand.ExecuteEvent += Save; - SaveToCommand.ExecuteEvent += SaveTo; - SaveAsTranslationModCommand.ExecuteEvent += SaveAsTranslationMod; + SaveCommand.ExecuteCommand += Save; + SaveToCommand.ExecuteCommand += SaveTo; + SaveAsTranslationModCommand.ExecuteCommand += SaveAsTranslationMod; } private void SaveAsTranslationMod() diff --git a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs index 9552a56..d0cf992 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -27,8 +28,8 @@ public class MoveEditWindowVM #endregion public MoveEditWindowVM() { - AddImageCommand.ExecuteEvent += AddImage; - ChangeImageCommand.ExecuteEvent += ChangeImage; + AddImageCommand.ExecuteCommand += AddImage; + ChangeImageCommand.ExecuteCommand += ChangeImage; Image.ValueChanged += Image_ValueChanged; } diff --git a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MovePageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MovePageVM.cs index cbf29b0..6a22e35 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MovePageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MovePageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -33,9 +34,9 @@ public class MovePageVM CurrentPet.ValueChanged += CurrentPet_ValueChanged; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void CurrentPet_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs index 0dc5238..d206850 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -27,8 +28,8 @@ public class PetEditWindowVM #endregion public PetEditWindowVM() { - AddImageCommand.ExecuteEvent += AddImage; - ChangeImageCommand.ExecuteEvent += ChangeImage; + AddImageCommand.ExecuteCommand += AddImage; + ChangeImageCommand.ExecuteCommand += ChangeImage; Image.ValueChanged += Image_ValueChanged; } diff --git a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs index 58d23e7..808fd08 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -29,9 +30,9 @@ public class PetPageVM ShowPets.Value = Pets; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void Search_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/SaveTranslationModWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/SaveTranslationModWindowVM.cs index d5a3d4b..fa96a84 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/SaveTranslationModWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/SaveTranslationModWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -37,7 +37,7 @@ public class SaveTranslationModWindowVM } CheckAll.ValueChanged += CheckAll_ValueChanged; CheckAll.SenderPropertyChanged += CheckAll_SenderPropertyChanged; - SaveCommand.ExecuteEvent += Save; + SaveCommand.ExecuteCommand += Save; } private void CheckAll_ValueChanged(ObservableValue sender, ValueChangedEventArgs e) diff --git a/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextEditWindowVM.cs index bfc544e..519b925 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextEditWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using System; using System.Collections.Generic; using System.Linq; diff --git a/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextPageVM.cs index 6b60e79..2a78a9f 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/SelectTextEdit/SelectTextPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -29,9 +30,9 @@ public class SelectTextPageVM { ShowSelectTexts.Value = SelectTexts; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void Search_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs index 5ec9ced..6870d70 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using Microsoft.Win32; using System; @@ -28,8 +29,8 @@ public class WorkEditWindowVM #endregion public WorkEditWindowVM() { - AddImageCommand.ExecuteEvent += AddImage; - ChangeImageCommand.ExecuteEvent += ChangeImage; + AddImageCommand.ExecuteCommand += AddImage; + ChangeImageCommand.ExecuteCommand += ChangeImage; Image.ValueChanged += Image_ValueChanged; } diff --git a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs index 15a4788..56af9c7 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; @@ -33,9 +34,9 @@ public class WorkPageVM CurrentPet.ValueChanged += CurrentPet_ValueChanged; Search.ValueChanged += Search_ValueChanged; - AddCommand.ExecuteEvent += Add; - EditCommand.ExecuteEvent += Edit; - RemoveCommand.ExecuteEvent += Remove; + AddCommand.ExecuteCommand += Add; + EditCommand.ExecuteCommand += Edit; + RemoveCommand.ExecuteCommand += Remove; } private void CurrentPet_ValueChanged( diff --git a/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs b/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs index 13c7d86..0b59975 100644 --- a/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModMakerWindowVM.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using LinePutScript; using LinePutScript.Converter; using LinePutScript.Localization.WPF; @@ -12,6 +12,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using System.Windows.Input; using VPet.ModMaker.Models; using VPet.ModMaker.Views; using VPet.ModMaker.Views.ModEdit; @@ -68,10 +69,10 @@ public class ModMakerWindowVM LoadHistories(); ModMakerWindow = window; ShowHistories.Value = Histories; - CreateNewModCommand.ExecuteEvent += CreateNewMod; - LoadModFromFileCommand.ExecuteEvent += LoadModFromFile; - ClearHistoriesCommand.ExecuteEvent += ClearHistories; - RemoveHistoryCommand.ExecuteEvent += RemoveHistory; + CreateNewModCommand.ExecuteCommand += CreateNewMod; + LoadModFromFileCommand.ExecuteCommand += LoadModFromFile; + ClearHistoriesCommand.ExecuteCommand += ClearHistories; + RemoveHistoryCommand.ExecuteCommand += RemoveHistory; HistoriesSearchText.ValueChanged += HistoriesSearchText_ValueChanged; } diff --git a/VPet.ModMaker/Views/ModEdit/AddCultureWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AddCultureWindow.xaml.cs index d63dccd..8dacda4 100644 --- a/VPet.ModMaker/Views/ModEdit/AddCultureWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AddCultureWindow.xaml.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using LinePutScript.Localization.WPF; using Panuon.WPF.UI; using System; diff --git a/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs index 3202721..8d3a987 100644 --- a/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs @@ -1,4 +1,5 @@ -using LinePutScript.Localization.WPF; +using HKW.Models; +using LinePutScript.Localization.WPF; using System; using System.Collections.Generic; using System.Linq; diff --git a/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs index e17b3c7..c9dfeea 100644 --- a/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs @@ -1,4 +1,5 @@ -using LinePutScript.Localization.WPF; +using HKW.Models; +using LinePutScript.Localization.WPF; using System; using System.Collections; using System.Collections.Generic; diff --git a/VPet.ModMaker/Views/ModEdit/AnimeEdit/SelectGraphTypeWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AnimeEdit/SelectGraphTypeWindow.xaml.cs index 9b597f2..8cd5a26 100644 --- a/VPet.ModMaker/Views/ModEdit/AnimeEdit/SelectGraphTypeWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AnimeEdit/SelectGraphTypeWindow.xaml.cs @@ -1,4 +1,5 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; +using HKW.Models; using System; using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/VPet.ModMaker/Views/ModEdit/I18nEdit/I18nEditWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/I18nEdit/I18nEditWindow.xaml.cs index 50c2e0b..291278a 100644 --- a/VPet.ModMaker/Views/ModEdit/I18nEdit/I18nEditWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/I18nEdit/I18nEditWindow.xaml.cs @@ -1,4 +1,4 @@ -using HKW.HKWViewModels.SimpleObservable; +using HKW.HKWUtils.Observable; using Panuon.WPF.UI; using System; using System.Collections.Generic; @@ -93,7 +93,7 @@ public partial class I18nEditWindow : WindowX MaxWidth = 500, Header = culture, Binding = new Binding(dataPath) { Mode = BindingMode.TwoWay }, - ElementStyle = (Style)Utils.ModMakerStyles["TextBlock_Wrap"], + ElementStyle = (Style)ModMakerInfo.NativeStyles["TextBlock_Wrap"], SortMemberPath = dataPath }; DataGrid_Datas.Columns.Add(column);