mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Gave each plugin its own child Ninject kernel
Plugins - Added support for validation in VMs
This commit is contained in:
1 parent
693ea29600
commit
2547b6a8bf
18 files changed
+132
-36
No files matched your search
@@ -10,16 +10,14 @@ namespace Artemis.UI.Screens.Modules
|
||||
{
|
||||
public class ModuleRootViewModel : Conductor<Screen>.Collection.OneActive
|
||||
{
|
||||
private readonly IKernel _kernel;
|
||||
private readonly IModuleVmFactory _moduleVmFactory;
|
||||
|
||||
public ModuleRootViewModel(Module module, IModuleVmFactory moduleVmFactory, IKernel kernel)
|
||||
public ModuleRootViewModel(Module module, IModuleVmFactory moduleVmFactory)
|
||||
{
|
||||
DisplayName = module?.DisplayName;
|
||||
Module = module;
|
||||
|
||||
_moduleVmFactory = moduleVmFactory;
|
||||
_kernel = kernel;
|
||||
}
|
||||
|
||||
public Module Module { get; }
|
||||
@@ -47,7 +45,7 @@ namespace Artemis.UI.Screens.Modules
|
||||
var module = new ConstructorArgument("module", Module);
|
||||
var displayName = new ConstructorArgument("displayName", DisplayName);
|
||||
|
||||
var viewModel = (ModuleViewModel) _kernel.Get(moduleTab.Type, module, displayName);
|
||||
var viewModel = (ModuleViewModel) Module.PluginInfo.Kernel.Get(moduleTab.Type, module, displayName);
|
||||
Items.Add(viewModel);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user