diff --git a/.idea/.idea.PSCHelpdesk/.idea/riderPublish.xml b/.idea/.idea.PSCHelpdesk/.idea/riderPublish.xml
index 6c0c664..9ef50fe 100644
--- a/.idea/.idea.PSCHelpdesk/.idea/riderPublish.xml
+++ b/.idea/.idea.PSCHelpdesk/.idea/riderPublish.xml
@@ -4,6 +4,10 @@
diff --git a/.idea/.idea.PSCHelpdesk/.idea/workspace.xml b/.idea/.idea.PSCHelpdesk/.idea/workspace.xml
index 28b72a8..5d5768f 100644
--- a/.idea/.idea.PSCHelpdesk/.idea/workspace.xml
+++ b/.idea/.idea.PSCHelpdesk/.idea/workspace.xml
@@ -11,23 +11,24 @@
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -41,16 +42,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -79,35 +114,42 @@
- {
+ "keyToString": {
+ ".NET Project.PSCHelpdesk.Desktop ohne plugin.executor": "Run",
+ ".NET Project.PSCHelpdesk.Desktop.executor": "Debug",
+ "Publish to folder.Build HetznerServer Plugin Debug.executor": "Run",
+ "Publish to folder.Copy Hetzner Target.executor": "Run",
+ "Publish to folder.Copy NextCloud Target.executor": "Run",
+ "Publish to folder.Publish HetznerServer to folder.executor": "Run",
+ "Publish to folder.Publish NextCloud to folder.executor": "Run",
+ "Publish to folder.Publish Nextcloud to folder.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "XThreadsFramesViewSplitterKey": "0.4427131",
+ "git-widget-placeholder": "master",
+ "ignore.virus.scanning.warn.message": "true",
+ "last_opened_file_path": "/home/thomas/RiderProjects/PSCHelpdesk/PSCHelpdesk/PSCHelpdesk.Desktop/bin/Debug/net9.0/plugins",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "SolutionBuilderGeneralOptionsPage",
+ "vue.rearranger.settings.migration": "true"
+ },
+ "keyToStringList": {
+ "com.intellij.ide.scratch.ScratchImplUtil$2/New Scratch File": [
+ "Shell Script"
+ ]
}
-}]]>
+}
-
-
+
+
-
-
+
+
@@ -161,9 +203,11 @@
+
+
+
+
-
-
@@ -188,8 +232,8 @@
-
-
+
+
@@ -212,6 +256,8 @@
+
+
@@ -372,58 +418,6 @@
-
- file://$PROJECT_DIR$/HetznerServer/HetznerServer.cs
- 23
-
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/Nextcloud/Nextcloud.cs
- 21
-
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/HetznerServer/HetznerServer.cs
- 24
-
-
-
-
-
-
-
-
-
-
-
- file://$PROJECT_DIR$/Vendor/Prise/AssemblyScanning/DefaultAssemblyScanner.cs
- 26
-
-
-
-
-
-
-
-
-
-
diff --git a/HetznerServer/HetznerServer.cs b/HetznerServer/HetznerServer.cs
index 3ae9c8b..8fce5b9 100644
--- a/HetznerServer/HetznerServer.cs
+++ b/HetznerServer/HetznerServer.cs
@@ -1,7 +1,4 @@
-using Avalonia.Controls;
using CommunityToolkit.Mvvm.DependencyInjection;
-using Prise.Plugin;
-using PSCHelpdesk.Plugins.HetznerServer.Menu;
using PSCHelpdesk.Plugins.HetznerServer.Service;
using PSCHelpdesk.Plugins.HetznerServer.ViewModels;
using PSCHelpdesk.Plugins.HetznerServer.Views;
@@ -11,7 +8,6 @@ using PSCHelpdesk.Shared.Service;
namespace PSCHelpdesk.Plugins.HetznerServer;
-[Plugin(PluginType = typeof(Contract))]
public class HetznerServer : Contract
{
public string GetName()
diff --git a/HetznerServer/HetznerServer.csproj b/HetznerServer/HetznerServer.csproj
index 9899c34..9c2a4dc 100644
--- a/HetznerServer/HetznerServer.csproj
+++ b/HetznerServer/HetznerServer.csproj
@@ -13,9 +13,6 @@
-
-
-
diff --git a/HetznerServer/HetznerServerBootstrap.cs b/HetznerServer/HetznerServerBootstrap.cs
deleted file mode 100644
index c39a228..0000000
--- a/HetznerServer/HetznerServerBootstrap.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using Prise.Plugin;
-using PSCHelpdesk.Plugins.HetznerServer.Service;
-using PSCHelpdesk.Plugins.HetznerServer.ViewModels;
-
-namespace PSCHelpdesk.Plugins.HetznerServer;
-
-[PluginBootstrapper(PluginType = typeof(HetznerServer))]
-public class HetznerServerBootstrap : IPluginBootstrapper
-{
-
- public IServiceCollection Bootstrap(IServiceCollection services)
- {
- services.AddScoped();
- services.AddTransient();
- return services;
- }
-}
diff --git a/HetznerServer/Menu/MainMenu.cs b/HetznerServer/Menu/MainMenu.cs
deleted file mode 100644
index 86b0685..0000000
--- a/HetznerServer/Menu/MainMenu.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Prise.Plugin;
-using PSCHelpdesk.Shared.Menu;
-using PSCHelpdesk.Shared.Service;
-
-namespace PSCHelpdesk.Plugins.HetznerServer.Menu;
-
-public class MainMenu
-{
- [PluginService(ProvidedBy = ProvidedBy.Host, ServiceType = typeof(IMenuService))]
- private readonly IMenuService menuService;
-
- public void addMenu()
- {
- this.menuService.AddMenuItem(new Item()
- {
- Header = "Hetzner",
- });
- }
-
-}
\ No newline at end of file
diff --git a/HetznerServer/MenuService.cs b/HetznerServer/MenuService.cs
deleted file mode 100644
index fb2c29e..0000000
--- a/HetznerServer/MenuService.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using Prise.Proxy;
-using PSCHelpdesk.Shared.Menu;
-using PSCHelpdesk.Shared.Service;
-
-namespace PSCHelpdesk.Plugins.HetznerServer;
-
-public class MenuService : ReverseProxy, IMenuService
-{
- public MenuService(object hostService) : base(hostService) { }
-
- public void AddMenuItem(Item item)
- {
- this.InvokeOnHostService- (new[] { item });
- }
-}
\ No newline at end of file
diff --git a/Nextcloud/Models/Note.cs b/Nextcloud/Models/Note.cs
index ebb0fe0..280554f 100644
--- a/Nextcloud/Models/Note.cs
+++ b/Nextcloud/Models/Note.cs
@@ -1,10 +1,18 @@
-namespace PSCHelpdesk.Plugins.Nextcloud.Models;
+using CommunityToolkit.Mvvm.ComponentModel;
-public class Note
+namespace PSCHelpdesk.Plugins.Nextcloud.Models;
+
+public class Note: ObservableObject
{
public long Id { get; set; }
-
- public string Content { get; set; }
+
+ private string _content;
+
+ public string Content
+ {
+ get { return _content; }
+ set { SetProperty(ref _content, value); }
+ }
public string Title { get; set; }
diff --git a/Nextcloud/Nextcloud.cs b/Nextcloud/Nextcloud.cs
index d0c2f38..2337f66 100644
--- a/Nextcloud/Nextcloud.cs
+++ b/Nextcloud/Nextcloud.cs
@@ -1,5 +1,4 @@
using CommunityToolkit.Mvvm.DependencyInjection;
-using Prise.Plugin;
using PSCHelpdesk.Plugins.Nextcloud.Services;
using PSCHelpdesk.Plugins.Nextcloud.ViewModels;
using PSCHelpdesk.Plugins.Nextcloud.Views;
@@ -9,7 +8,6 @@ using PSCHelpdesk.Shared.Service;
namespace PSCHelpdesk.Plugins.Nextcloud;
-[Plugin(PluginType = typeof(Contract))]
public class Nextcloud : Contract
{
public string GetName()
diff --git a/Nextcloud/Nextcloud.csproj b/Nextcloud/Nextcloud.csproj
index 55c4e45..3d993d4 100644
--- a/Nextcloud/Nextcloud.csproj
+++ b/Nextcloud/Nextcloud.csproj
@@ -8,23 +8,34 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
..\..\..\.nuget\packages\communitytoolkit.mvvm\8.3.2\lib\net8.0\CommunityToolkit.Mvvm.dll
+
+
+
+
diff --git a/Nextcloud/ViewModels/NotesViewModel.cs b/Nextcloud/ViewModels/NotesViewModel.cs
index 2ef9bef..93db0c6 100644
--- a/Nextcloud/ViewModels/NotesViewModel.cs
+++ b/Nextcloud/ViewModels/NotesViewModel.cs
@@ -1,11 +1,7 @@
using System.Windows.Input;
-using Avalonia.Controls;
-using Avalonia.Threading;
using CommunityToolkit.Mvvm.DependencyInjection;
-using CommunityToolkit.Mvvm.Input;
using PSCHelpdesk.Plugins.Nextcloud.Models;
using PSCHelpdesk.Plugins.Nextcloud.Services;
-using PSCHelpdesk.Plugins.Nextcloud.Views;
using PSCHelpdesk.Shared.Service;
using PSCHelpdesk.Shared.ViewModels;
using ReactiveUI;
diff --git a/Nextcloud/Views/NotesView.axaml b/Nextcloud/Views/NotesView.axaml
index 166dce0..0457ef0 100644
--- a/Nextcloud/Views/NotesView.axaml
+++ b/Nextcloud/Views/NotesView.axaml
@@ -5,6 +5,7 @@
xmlns:vm="clr-namespace:PSCHelpdesk.Plugins.Nextcloud.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PSCHelpdesk.Plugins.Nextcloud.Views.NotesView"
+ xmlns:md="https://github.com/whistyun/Markdown.Avalonia"
x:DataType="vm:NotesViewModel">
@@ -13,7 +14,7 @@
DisplayMode="Inline"
OpenPaneLength="300">
-
+
@@ -24,8 +25,14 @@
-
-
+
+ Title
+
+ Content
+
+
+
\ No newline at end of file
diff --git a/PSCHelpdesk.sln b/PSCHelpdesk.sln
index c15c3bc..52c2495 100644
--- a/PSCHelpdesk.sln
+++ b/PSCHelpdesk.sln
@@ -20,14 +20,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nextcloud", "Nextcloud\Next
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vendor", "Vendor", "{D45462B2-C09A-4BC6-A8B1-F03C6533B084}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prise", "Vendor\Prise\Prise.csproj", "{AD222F87-EAC5-4120-AA33-EB32DF2DDCD5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prise.Plugin", "Vendor\Prise.Plugin\Prise.Plugin.csproj", "{F4EF7157-C5F0-4444-9E49-28F6BD56295F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prise.ReverseProxy", "Vendor\Prise.ReverseProxy\Prise.ReverseProxy.csproj", "{52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Prise.Proxy", "Vendor\Prise.Proxy\Prise.Proxy.csproj", "{79029F78-5113-46E4-8896-436707A7251F}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -70,29 +62,9 @@ Global
{4C34E3F4-718D-4E15-97A2-AE61A4ACEE02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C34E3F4-718D-4E15-97A2-AE61A4ACEE02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C34E3F4-718D-4E15-97A2-AE61A4ACEE02}.Release|Any CPU.Build.0 = Release|Any CPU
- {AD222F87-EAC5-4120-AA33-EB32DF2DDCD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AD222F87-EAC5-4120-AA33-EB32DF2DDCD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AD222F87-EAC5-4120-AA33-EB32DF2DDCD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AD222F87-EAC5-4120-AA33-EB32DF2DDCD5}.Release|Any CPU.Build.0 = Release|Any CPU
- {F4EF7157-C5F0-4444-9E49-28F6BD56295F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F4EF7157-C5F0-4444-9E49-28F6BD56295F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F4EF7157-C5F0-4444-9E49-28F6BD56295F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F4EF7157-C5F0-4444-9E49-28F6BD56295F}.Release|Any CPU.Build.0 = Release|Any CPU
- {52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA}.Release|Any CPU.Build.0 = Release|Any CPU
- {79029F78-5113-46E4-8896-436707A7251F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {79029F78-5113-46E4-8896-436707A7251F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {79029F78-5113-46E4-8896-436707A7251F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {79029F78-5113-46E4-8896-436707A7251F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{552272D2-9506-4F9E-9D53-E908E53D9039} = {E7A87869-4D47-4292-BE39-77D36933088C}
{4C34E3F4-718D-4E15-97A2-AE61A4ACEE02} = {E7A87869-4D47-4292-BE39-77D36933088C}
- {AD222F87-EAC5-4120-AA33-EB32DF2DDCD5} = {D45462B2-C09A-4BC6-A8B1-F03C6533B084}
- {F4EF7157-C5F0-4444-9E49-28F6BD56295F} = {D45462B2-C09A-4BC6-A8B1-F03C6533B084}
- {52EFDD1B-B775-49A1-BD3D-E7B7F6A989EA} = {D45462B2-C09A-4BC6-A8B1-F03C6533B084}
- {79029F78-5113-46E4-8896-436707A7251F} = {D45462B2-C09A-4BC6-A8B1-F03C6533B084}
EndGlobalSection
EndGlobal
diff --git a/PSCHelpdesk.sln.DotSettings.user b/PSCHelpdesk.sln.DotSettings.user
index 40fec4b..f0910b6 100644
--- a/PSCHelpdesk.sln.DotSettings.user
+++ b/PSCHelpdesk.sln.DotSettings.user
@@ -2,10 +2,13 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
@@ -20,6 +23,7 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
@@ -32,16 +36,20 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
@@ -56,6 +64,7 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
ForceIncluded
@@ -80,10 +89,14 @@
True
+
+
True
+
+
\ No newline at end of file
diff --git a/PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj b/PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj
index 79923d4..bef86cc 100644
--- a/PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj
+++ b/PSCHelpdesk/PSCHelpdesk.Desktop/PSCHelpdesk.Desktop.csproj
@@ -27,4 +27,8 @@
..\..\..\..\.nuget\packages\avalonia\11.2.0\ref\net8.0\Avalonia.Controls.dll
+
+
+
+
diff --git a/PSCHelpdesk/PSCHelpdesk.Desktop/postbuild.bat b/PSCHelpdesk/PSCHelpdesk.Desktop/postbuild.bat
new file mode 100644
index 0000000..802e88c
--- /dev/null
+++ b/PSCHelpdesk/PSCHelpdesk.Desktop/postbuild.bat
@@ -0,0 +1,12 @@
+echo Nextcloud
+copy %1\_dist\nextcloud\Nextcloud.dll %2
+copy %1\_dist\nextcloud\RestSharp.dll %2
+copy %1\_dist\nextcloud\Markdown.Avalonia* %2
+copy %1\_dist\nextcloud\ColorTextBlock.Avalonia* %2
+copy %1\_dist\nextcloud\AvaloniaEdit* %2
+copy %1\_dist\nextcloud\HtmlAgilityPack* %2
+copy %1\_dist\nextcloud\Avalonia.Svg* %2
+echo Hetzner
+copy %1\_dist\hetzner\HetznerServer.dll %2
+copy %1\_dist\hetzner\HetznerCloudApi.dll %2
+copy %1\_dist\hetzner\Renci.SshNet.dll %2
diff --git a/PSCHelpdesk/PSCHelpdesk/Plugins/PluginLoadContext.cs b/PSCHelpdesk/PSCHelpdesk/Plugins/PluginLoadContext.cs
new file mode 100644
index 0000000..9745423
--- /dev/null
+++ b/PSCHelpdesk/PSCHelpdesk/Plugins/PluginLoadContext.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Reflection;
+using System.Runtime.Loader;
+
+namespace PSCHelpdesk.Plugins;
+
+internal class PluginLoadContext : AssemblyLoadContext
+{
+ private readonly AssemblyDependencyResolver resolver;
+
+ public PluginLoadContext(string pluginPath)
+ {
+ this.resolver = new AssemblyDependencyResolver(pluginPath);
+ }
+
+ ///
+ protected override Assembly Load(AssemblyName assemblyName)
+ {
+ string assemblyPath = this.resolver.ResolveAssemblyToPath(assemblyName);
+ if (assemblyPath != null)
+ {
+ return this.LoadFromAssemblyPath(assemblyPath);
+ }
+
+ return null;
+ }
+
+ ///
+ protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
+ {
+ string libraryPath = this.resolver.ResolveUnmanagedDllToPath(unmanagedDllName);
+ if (libraryPath != null)
+ {
+ return this.LoadUnmanagedDllFromPath(libraryPath);
+ }
+
+ return IntPtr.Zero;
+ }
+}
\ No newline at end of file
diff --git a/PSCHelpdesk/PSCHelpdesk/Services/PluginManager.cs b/PSCHelpdesk/PSCHelpdesk/Services/PluginManager.cs
new file mode 100644
index 0000000..d5e9669
--- /dev/null
+++ b/PSCHelpdesk/PSCHelpdesk/Services/PluginManager.cs
@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using PSCHelpdesk.Plugins;
+using PSCHelpdesk.Shared.Plugin;
+
+namespace PSCHelpdesk.Services;
+
+public class PluginManager
+{
+
+ private List _pluginTypes;
+
+
+ public PluginManager()
+ {
+ _pluginTypes = new List();
+ LoadPlugins();
+ }
+
+ private void LoadPlugins()
+ {
+ var dllFileNames = Directory.GetFiles(getPluginPath(), "*.dll", SearchOption.TopDirectoryOnly);
+
+ var assemblies = new List(dllFileNames.Length);
+ foreach (string dllFile in dllFileNames)
+ {
+ assemblies.Add(LoadPlugin(dllFile));
+ }
+
+ var pluginType = typeof(Contract);
+ var pluginTypes = new List();
+ foreach (var assembly in assemblies)
+ {
+ if (assembly != null)
+ {
+ try
+ {
+ var types = assembly.GetTypes();
+ foreach (var type in types)
+ {
+ if (type.IsInterface || type.IsAbstract)
+ {
+ continue;
+ }
+ else
+ {
+ if (pluginType.IsAssignableFrom(type))
+ {
+ pluginTypes.Add(type);
+
+ }
+ }
+ }
+ }
+ catch (Exception)
+ {
+ Debug.WriteLine($"Failed to load plugin {assembly.FullName}");
+ }
+ }
+ }
+
+ foreach (var type in pluginTypes)
+ {
+ var plugin = (Contract)Activator.CreateInstance(type);
+ plugin.Configure();
+ _pluginTypes.AddRange(plugin.LoadViews());
+ }
+
+ }
+
+ private string getPluginPath()
+ {
+ var pathToThisProgram = Assembly.GetExecutingAssembly() // this assembly location (/bin/Debug/netcoreapp3.1)
+ .Location;
+ var pathToExecutingDir = Path.GetDirectoryName(pathToThisProgram);
+ //return Path.GetFullPath(Path.Combine(pathToExecutingDir, "../../../../../_dist"));
+ //return pathToExecutingDir;
+ return Path.Combine(pathToExecutingDir, "plugins");
+ }
+
+ private static Assembly LoadPlugin(string fullPath)
+ {
+ PluginLoadContext loadContext = new PluginLoadContext(fullPath);
+ return loadContext.LoadFromAssemblyName(new AssemblyName(Path.GetFileNameWithoutExtension(fullPath)));
+ }
+
+ public bool ViewExists(string name)
+ {
+ var found= _pluginTypes.Exists(t => t.FullName == name);
+
+ return found;
+ }
+
+ public Type GetView(string viewName)
+ {
+ return this._pluginTypes.First(e => e.FullName == viewName);
+ }
+}
\ No newline at end of file
diff --git a/PSCHelpdesk/PSCHelpdesk/Startup.cs b/PSCHelpdesk/PSCHelpdesk/Startup.cs
index 6c885d6..fb94e8b 100644
--- a/PSCHelpdesk/PSCHelpdesk/Startup.cs
+++ b/PSCHelpdesk/PSCHelpdesk/Startup.cs
@@ -26,7 +26,6 @@ class Startup
var te = new ServiceCollection()
.AddSingleton()
- .AddPrise()
.AddFactory(()=> new AvaloniaPluginResultConverter())
.AddSingleton()
.AddSingleton(settingsManager)
@@ -34,7 +33,7 @@ class Startup
.AddSingleton(taskManager)
.AddSingleton(menuService)
.AddSingleton(new TestService())
- .AddSingleton()
+ .AddSingleton()
.AddSingleton(toastManager)
.AddTransient();
diff --git a/PSCHelpdesk/PSCHelpdesk/ViewLocator.cs b/PSCHelpdesk/PSCHelpdesk/ViewLocator.cs
index 6927d12..b6f3715 100644
--- a/PSCHelpdesk/PSCHelpdesk/ViewLocator.cs
+++ b/PSCHelpdesk/PSCHelpdesk/ViewLocator.cs
@@ -10,7 +10,7 @@ namespace PSCHelpdesk;
public class ViewLocator : IDataTemplate
{
- private PluginService _pluginService;
+ private PluginManager _pluginService;
public Control? Build(object? data)
@@ -22,7 +22,7 @@ public class ViewLocator : IDataTemplate
if (_pluginService == null)
{
- _pluginService = Ioc.Default.GetService();
+ _pluginService = Ioc.Default.GetService();
}
var name = data.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
@@ -42,8 +42,8 @@ public class ViewLocator : IDataTemplate
if (_pluginService.ViewExists(name))
{
- var v = _pluginService.GetView(name);
- return v;
+ var control = (Control)Activator.CreateInstance(_pluginService.GetView(name));
+ return control;
}
diff --git a/PSCHelpdesk/PSCHelpdesk/ViewModels/PluginListViewModel.cs b/PSCHelpdesk/PSCHelpdesk/ViewModels/PluginListViewModel.cs
index cec9db3..9020b83 100644
--- a/PSCHelpdesk/PSCHelpdesk/ViewModels/PluginListViewModel.cs
+++ b/PSCHelpdesk/PSCHelpdesk/ViewModels/PluginListViewModel.cs
@@ -16,7 +16,7 @@ class PluginListViewModel : ViewModelBase, IViewModelBase
private PluginService _pluginService { get; }
- public PluginListViewModel(PluginService pluginService)
+ public PluginListViewModel(PluginManager pluginService)
{
this.Plugins = new AvaloniaList();
@@ -24,12 +24,12 @@ class PluginListViewModel : ViewModelBase, IViewModelBase
LoadAllPluginsCommand = new RelayCommand