Changed plugins to abstract classes

This commit is contained in:
SpoinkyNL committed 2019-04-16 00:24:50 +02:00
1 parent c9277ecc4e
commit f63a7b91c8
36 files changed
+657 -300

No files matched your search

+6 -5
View File
@@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows.Controls;
using Artemis.Core.Events;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
using Artemis.Core.Services.Interfaces;
using Artemis.UI.ViewModels.Interfaces;
@@ -28,8 +29,8 @@ namespace Artemis.UI.ViewModels
ActiveItem = _artemisViewModels.First(v => v.GetType() == typeof(HomeViewModel));
// Sync up with the plugin service
Modules = new BindableCollection<IModule>();
Modules.AddRange(_pluginService.GetPluginsOfType<IModule>());
Modules = new BindableCollection<Module>();
Modules.AddRange(_pluginService.GetPluginsOfType<Module>());
_pluginService.PluginEnabled += PluginServiceOnPluginEnabled;
_pluginService.PluginDisabled += PluginServiceOnPluginDisabled;
@@ -37,10 +38,10 @@ namespace Artemis.UI.ViewModels
PropertyChanged += OnSelectedPageChanged;
}
public IObservableCollection<IModule> Modules { get; set; }
public IObservableCollection<Module> Modules { get; set; }
public bool MenuOpen { get; set; }
public ListBoxItem SelectedPage { get; set; }
public IModule SelectedModule { get; set; }
public Module SelectedModule { get; set; }
public async Task NavigateToSelectedModule()
{
@@ -66,7 +67,7 @@ namespace Artemis.UI.ViewModels
Modules.Remove(existing);
}
if (e.PluginInfo.Instance is IModule module)
if (e.PluginInfo.Instance is Module module)
Modules.Add(module);
}
+2 -1
View File
@@ -9,6 +9,7 @@
xmlns:vms="clr-namespace:Artemis.UI.ViewModels"
xmlns:models="clr-namespace:Artemis.Core.Plugins.Models;assembly=Artemis.Core"
xmlns:interfaces="clr-namespace:Artemis.Core.Plugins.Interfaces;assembly=Artemis.Core"
xmlns:abstract="clr-namespace:Artemis.Core.Plugins.Abstract;assembly=Artemis.Core"
mc:Ignorable="d"
GlowBrush="{DynamicResource AccentColorBrush}"
FontFamily="{StaticResource DefaultFont}"
@@ -127,7 +128,7 @@
SelectedItem="{Binding SelectedModule}"
DockPanel.Dock="Top">
<ListBox.ItemTemplate>
<DataTemplate DataType="interfaces:IModule">
<DataTemplate DataType="abstract:Module">
<DockPanel HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Margin="0">