mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Profile modules - Encapsulation fixes
Data bindings - Abstracted the data model selection
This commit is contained in:
1 parent
e98ae43ea1
commit
a975629f99
20 files changed
+502
-189
No files matched your search
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.DataModelExpansions;
|
||||
using Artemis.Core.Modules;
|
||||
using Artemis.Core.Services;
|
||||
using Ninject;
|
||||
using Ninject.Parameters;
|
||||
@@ -178,6 +179,11 @@ namespace Artemis.UI.Shared.Services
|
||||
}
|
||||
}
|
||||
|
||||
public DataModelSelectionViewModel GetDataModelSelectionViewModel(Module module)
|
||||
{
|
||||
return _kernel.Get<DataModelSelectionViewModel>(new ConstructorArgument("module", module));
|
||||
}
|
||||
|
||||
private DataModelInputViewModel InstantiateDataModelInputViewModel(DataModelVisualizationRegistration registration, DataModelPropertyAttribute description, object initialValue)
|
||||
{
|
||||
// The view models expecting value types shouldn't be given null, avoid that
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.DataModelExpansions;
|
||||
using Artemis.Core.Modules;
|
||||
|
||||
namespace Artemis.UI.Shared.Services
|
||||
{
|
||||
@@ -26,5 +27,7 @@ namespace Artemis.UI.Shared.Services
|
||||
|
||||
DataModelDisplayViewModel GetDataModelDisplayViewModel(Type propertyType);
|
||||
DataModelInputViewModel GetDataModelInputViewModel(Type propertyType, DataModelPropertyAttribute description, object initialValue, Action<object, bool> updateCallback);
|
||||
|
||||
DataModelSelectionViewModel GetDataModelSelectionViewModel(Module module);
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ namespace Artemis.UI.Shared.Services
|
||||
if (existing != null)
|
||||
{
|
||||
if (existing.PluginInfo != pluginInfo)
|
||||
throw new ArtemisPluginException($"Cannot register property editor for type {supportedType.Name} because an editor was already registered by {pluginInfo.Name}");
|
||||
throw new ArtemisPluginException($"Cannot register property editor for type {supportedType.Name} because an editor was already registered by {existing.PluginInfo.Name}");
|
||||
return existing;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user