From 9e8b3b89f8c36c022cd0f7fd24c72917d7084ad8 Mon Sep 17 00:00:00 2001 From: WeeXnes Date: Wed, 9 Apr 2025 08:05:58 +0200 Subject: [PATCH] plugin prototype working --- ExamplePlugin/ExamplePlugin.cs | 14 +++++++++++++- ExamplePlugin/ExamplePlugin.csproj | 17 +++++++++++++++++ ExamplePlugin/ExampleUi.xaml | 13 +++++++++++++ ExamplePlugin/ExampleUi.xaml.cs | 13 +++++++++++++ WXPlugin/PluginCore/IPluginBase.cs | 4 ++++ WXPlugin/WXPlugin.csproj | 12 ++++++++++++ WeeXnes/App.xaml.cs | 15 +++++++++------ WeeXnes/Core/Global.cs | 4 +++- WeeXnes/Core/PluginManager.cs | 1 + WeeXnes/MainWindow.xaml | 4 +++- WeeXnes/MainWindow.xaml.cs | 9 ++++++++- WeeXnes/WeeXnes.csproj | 2 +- 12 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 ExamplePlugin/ExampleUi.xaml create mode 100644 ExamplePlugin/ExampleUi.xaml.cs diff --git a/ExamplePlugin/ExamplePlugin.cs b/ExamplePlugin/ExamplePlugin.cs index 5308736..5afebe0 100644 --- a/ExamplePlugin/ExamplePlugin.cs +++ b/ExamplePlugin/ExamplePlugin.cs @@ -1,4 +1,7 @@ using System; +using System.Windows.Controls; +using Wpf.Ui.Common; +using Wpf.Ui.Controls; using WXPlugin.PluginCore; namespace ExamplePlugin @@ -8,6 +11,15 @@ namespace ExamplePlugin public String Name { get; set; } = "Example Plugin"; public String Description { get; set; } = "This is an example plugin."; + public Page UiPage { get; set; } = new ExampleUi(); + public NavigationItem NavIcon { get; set; } = new NavigationItem + { + Content = "Plugin", + Icon = SymbolRegular.Syringe20, + PageTag = "examplePlugin", + PageType = typeof(ExampleUi), + }; + public void Execute() { throw new NotImplementedException(); @@ -15,7 +27,7 @@ namespace ExamplePlugin public void Initialize() { - throw new NotImplementedException(); + //throw new NotImplementedException(); } } } \ No newline at end of file diff --git a/ExamplePlugin/ExamplePlugin.csproj b/ExamplePlugin/ExamplePlugin.csproj index 6bc6089..d1b8c21 100644 --- a/ExamplePlugin/ExamplePlugin.csproj +++ b/ExamplePlugin/ExamplePlugin.csproj @@ -33,13 +33,24 @@ 4 + + + + ..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll + + + + + ..\packages\WPF-UI.2.0.3\lib\net48\Wpf.Ui.dll + + @@ -48,6 +59,12 @@ WXPlugin + + + + + +