mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Dynamic data model - Removed DataModel constraint
Dynamic data model - Added ability to provide custom description attribute
This commit is contained in:
1 parent
5e345fed7c
commit
8cba36f5d4
4 files changed
+182
-96
No files matched your search
+4
-2
@@ -239,9 +239,10 @@ namespace Artemis.UI.Shared
|
||||
// Add missing dynamic children
|
||||
object? value = Parent == null || Parent.IsRootViewModel ? DataModel : DataModelPath?.GetValue();
|
||||
if (value is DataModel dataModel)
|
||||
foreach (KeyValuePair<string, DataModel> kvp in dataModel.DynamicDataModels)
|
||||
{
|
||||
foreach (var (key, dynamicChild) in dataModel.DynamicChildren)
|
||||
{
|
||||
string childPath = AppendToPath(kvp.Key);
|
||||
string childPath = AppendToPath(key);
|
||||
if (Children.Any(c => c.Path != null && c.Path.Equals(childPath)))
|
||||
continue;
|
||||
|
||||
@@ -249,6 +250,7 @@ namespace Artemis.UI.Shared
|
||||
if (child != null)
|
||||
Children.Add(child);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove dynamic children that have been removed from the data model
|
||||
List<DataModelVisualizationViewModel> toRemoveDynamic = Children.Where(c => c.DataModelPath != null && !c.DataModelPath.IsValid).ToList();
|
||||
|
||||
Reference in new issue
Block a user