Fixed plugin binding and reworked some interfaces to abstract classes

This commit is contained in:
SpoinkyNL committed 2019-04-11 19:52:28 +02:00
1 parent 571a3fe168
commit 3689db9325
17 files changed
+88 -82

No files matched your search

@@ -1,11 +1,16 @@
using Artemis.Core.Attributes;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Plugins.Modules.General
{
public class GeneralDataModel : IModuleDataModel
public class GeneralDataModel : ModuleDataModel
{
[DataModelProperty(DisplayName = "Unique boolean")]
public bool PropertyUniqueToThisDm { get; set; }
public GeneralDataModel(IModule module) : base(module)
{
}
}
}
@@ -13,23 +13,20 @@ namespace Artemis.Plugins.Modules.General
{
public class GeneralModule : IModule
{
private readonly IRgbService _rgbService;
private readonly RGBSurface _surface;
private Dictionary<Led, Color> _colors;
public GeneralModule()
{
}
public GeneralModule(IRgbService rgbService)
{
_rgbService = rgbService;
_surface = _rgbService.Surface;
var rgbService1 = rgbService;
_surface = rgbService1.Surface;
_colors = new Dictionary<Led, Color>();
_rgbService.FinishedLoadedDevices += (sender, args) => PopulateColors();
rgbService1.FinishedLoadedDevices += (sender, args) => PopulateColors();
}
public string DisplayName => "General";
// True since the main data model is all this module shows
public bool ExpandsMainDataModel => true;
@@ -58,7 +55,7 @@ namespace Artemis.Plugins.Modules.General
public IScreen GetMainViewModel()
{
return new GeneralViewModel();
return new GeneralViewModel(this);
}
public void Dispose()
@@ -1,11 +1,12 @@
using Artemis.Core.Plugins.Interfaces;
using Artemis.Core.Plugins.Models;
using Stylet;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Interfaces;
namespace Artemis.Plugins.Modules.General.ViewModels
{
public class GeneralViewModel : Screen, IModuleViewModel
public class GeneralViewModel : ModuleViewModel
{
public PluginInfo PluginInfo { get; set; }
public GeneralViewModel(IModule module) : base(module)
{
}
}
}
@@ -6,5 +6,7 @@
xmlns:local="clr-namespace:Artemis.Plugins.Modules.General.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid />
<Grid>
<Label>Test</Label>
</Grid>
</UserControl>