mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Data model - Support all lists implementing IEnumerable<>
This commit is contained in:
1 parent
17d41647b6
commit
3b6753a0ff
9 files changed
+91
-128
No files matched your search
@@ -86,7 +86,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
public void Initialize()
|
||||
{
|
||||
TargetSelectionViewModel = _dataModelUIService.GetDynamicSelectionViewModel(_profileEditorService.GetCurrentModule());
|
||||
TargetSelectionViewModel.FilterTypes = new[] {typeof(IList)};
|
||||
TargetSelectionViewModel.FilterTypes = new[] {typeof(IEnumerable<>)};
|
||||
TargetSelectionViewModel.ButtonBrush = new SolidColorBrush(Color.FromRgb(71, 108, 188));
|
||||
TargetSelectionViewModel.Placeholder = "Select a list";
|
||||
TargetSelectionViewModel.PropertySelected += TargetSelectionViewModelOnPropertySelected;
|
||||
|
||||
+14
-15
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Artemis.Core;
|
||||
using Artemis.Core.DataModelExpansions;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Screens.ProfileEditor.Conditions.Abstract;
|
||||
using Artemis.UI.Shared;
|
||||
@@ -83,19 +82,6 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
|
||||
public DelegateCommand SelectOperatorCommand { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (LeftSideSelectionViewModel != null)
|
||||
{
|
||||
LeftSideSelectionViewModel.PropertySelected -= LeftSideOnPropertySelected;
|
||||
LeftSideSelectionViewModel.Dispose();
|
||||
LeftSideSelectionViewModel = null;
|
||||
}
|
||||
|
||||
DisposeRightSideStatic();
|
||||
DisposeRightSideDynamic();
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
@@ -118,7 +104,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
{
|
||||
LeftSideSelectionViewModel.FilterTypes = _supportedInputTypes.ToArray();
|
||||
LeftSideSelectionViewModel.ChangeDataModelPath(DataModelConditionPredicate.LeftPath);
|
||||
|
||||
|
||||
Type leftSideType = LeftSideSelectionViewModel.DataModelPath?.GetPropertyType();
|
||||
|
||||
// Get the supported operators
|
||||
@@ -239,5 +225,18 @@ namespace Artemis.UI.Screens.ProfileEditor.Conditions
|
||||
RightSideSelectionViewModel = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (LeftSideSelectionViewModel != null)
|
||||
{
|
||||
LeftSideSelectionViewModel.PropertySelected -= LeftSideOnPropertySelected;
|
||||
LeftSideSelectionViewModel.Dispose();
|
||||
LeftSideSelectionViewModel = null;
|
||||
}
|
||||
|
||||
DisposeRightSideStatic();
|
||||
DisposeRightSideDynamic();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user