From c4d33fb3de7f7760b3e0f22e4e2ed10f0e7105a3 Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Fri, 8 Sep 2023 00:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E7=B1=BB=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E8=B5=84=E6=BA=90=E8=BD=BD?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet.ModMaker/App.xaml.cs | 4 +++- VPet.ModMaker/Models/ModMaker.cs | 4 ++-- .../Properties/DesignTimeResources.xaml | 12 ++++++++++++ VPet.ModMaker/Styles.cs | 16 ++++++++++++++++ VPet.ModMaker/Styles.xaml | 1 + VPet.ModMaker/VPet.ModMaker.csproj | 13 ++++++++++--- VPet.ModMaker/ViewModels/ModMakerWindowVM.cs | 1 + VPet.ModMaker/packages.config | 4 ++-- 8 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 VPet.ModMaker/Properties/DesignTimeResources.xaml create mode 100644 VPet.ModMaker/Styles.cs diff --git a/VPet.ModMaker/App.xaml.cs b/VPet.ModMaker/App.xaml.cs index 708af23..37c61ba 100644 --- a/VPet.ModMaker/App.xaml.cs +++ b/VPet.ModMaker/App.xaml.cs @@ -11,5 +11,7 @@ namespace VPet.ModMaker /// /// Interaction logic for App.xaml /// - public partial class App : Application { } + public partial class App : Application + { + } } diff --git a/VPet.ModMaker/Models/ModMaker.cs b/VPet.ModMaker/Models/ModMaker.cs index c480213..84fe804 100644 --- a/VPet.ModMaker/Models/ModMaker.cs +++ b/VPet.ModMaker/Models/ModMaker.cs @@ -23,7 +23,6 @@ public class ModMaker : MainPlugin public ModMaker(IMainWindow mainwin) : base(mainwin) { } - public override void LoadPlugin() { Set = MW.Set.FindLine("ModMaker"); @@ -41,11 +40,12 @@ public class ModMaker : MainPlugin modset.Items.Add(menuset); } - public override void Setting() { if (Maker == null) { + // 载入ModMaker资源 + Application.Current.Resources.MergedDictionaries.Add(new ModMakerStyles()); Maker = new ModMakerWindow(); Maker.ModMaker = this; Maker.Show(); diff --git a/VPet.ModMaker/Properties/DesignTimeResources.xaml b/VPet.ModMaker/Properties/DesignTimeResources.xaml new file mode 100644 index 0000000..6ffe8bc --- /dev/null +++ b/VPet.ModMaker/Properties/DesignTimeResources.xaml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/VPet.ModMaker/Styles.cs b/VPet.ModMaker/Styles.cs new file mode 100644 index 0000000..314fbdc --- /dev/null +++ b/VPet.ModMaker/Styles.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace VPet.ModMaker; + +public partial class ModMakerStyles : ResourceDictionary +{ + public ModMakerStyles() + { + InitializeComponent(); + } +} diff --git a/VPet.ModMaker/Styles.xaml b/VPet.ModMaker/Styles.xaml index f50a7f4..1c68f3c 100644 --- a/VPet.ModMaker/Styles.xaml +++ b/VPet.ModMaker/Styles.xaml @@ -27,4 +27,5 @@ +