From b134668d1977f85750e20ab57eabeb4eb01088e2 Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Fri, 1 Nov 2024 10:27:14 +0000 Subject: [PATCH] GroupModel to profiledGroups --- TuneUp/TuneUpWindowViewModel.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/TuneUp/TuneUpWindowViewModel.cs b/TuneUp/TuneUpWindowViewModel.cs index 074b474..55592b1 100644 --- a/TuneUp/TuneUpWindowViewModel.cs +++ b/TuneUp/TuneUpWindowViewModel.cs @@ -580,6 +580,7 @@ private void CreateGroupNodesForCollection(ObservableCollection(); + var nodesToAdd = new HashSet(); var sortedNodes = collection.OrderBy(n => n.ExecutionOrderNumber).ToList(); @@ -612,20 +613,16 @@ private void CreateGroupNodesForCollection(ObservableCollection n.GUID.Equals(pNode.GroupGUID)) }; + nodesToAdd.Add(pGroup); groupDictionary[pGroup.NodeGUID] = pGroup; groupModelDictionary[pNode.GroupGUID].Add(pGroup); // Create an register a new time node - var timeNode = CreateAndRegisterGroupTimeNode(pGroup); - - GetCollectionViewSource(collection).Dispatcher.Invoke(() => - { - collection.Add(timeNode); - collection.Add(pGroup); - }); + nodesToAdd.Add(CreateAndRegisterGroupTimeNode(pGroup)); // Update group-related properties for all nodes in the group foreach (var node in nodesInGroup) @@ -635,6 +632,14 @@ private void CreateGroupNodesForCollection(ObservableCollection + { + foreach (var node in nodesToAdd) + { + collection.Add(node); + } + }); } internal void OnNodeExecutionBegin(NodeModel nm)