From 4e993f3a134414b1a3183ef847bf7b74945d29ff Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Wed, 28 Feb 2024 15:06:45 -0500 Subject: [PATCH 1/2] add --- src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs | 2 +- src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs b/src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs index 7e274e142f0..44d4e2f707b 100644 --- a/src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs +++ b/src/DynamoCoreWpf/Utilities/CompactBubbleHandler.cs @@ -25,7 +25,7 @@ public static CompactBubbleViewModel Process(MirrorData value) { items = 0; var viewModel = ProcessThing(value, true); - viewModel.SetObjectType(value.Data); + viewModel.SetObjectType(value?.Data); viewModel.NumberOfItems = items; return viewModel; diff --git a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs index 642dc0fc51a..c1828344520 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs @@ -761,7 +761,7 @@ internal bool HandleMouseRelease(object sender, MouseButtonEventArgs e) .ToList(); // AddModelsToGroupModelCommand adds models to the selected group - // therefor we add the dropGroup to the selection before calling + // therefore we add the dropGroup to the selection before calling // the command. DynamoSelection.Instance.Selection.AddUnique(dropGroup.AnnotationModel); @@ -794,7 +794,9 @@ internal bool HandleMouseRelease(object sender, MouseButtonEventArgs e) owningWorkspace.DynamoViewModel.AddModelsToGroupModelCommand.Execute(null); } dropGroup.NodeHoveringState = false; - dropGroup.SelectAll(); + //select only those models which were added to the group + DynamoSelection.Instance.ClearSelection(); + DynamoSelection.Instance.Selection.AddRange(modelsToAdd); } SetCurrentState(State.None); // Dragging operation ended. From ea25200bf3f0b2f1fcf674d23043d177be376741 Mon Sep 17 00:00:00 2001 From: Ashish Aggarwal Date: Wed, 28 Feb 2024 15:11:15 -0500 Subject: [PATCH 2/2] Update AnnotationViewModel.cs --- src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs index 578447dcdb7..ee95fe3f69b 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs @@ -642,7 +642,7 @@ public AnnotationViewModel(WorkspaceViewModel workspaceViewModel, AnnotationMode ViewModelBases = this.WorkspaceViewModel.GetViewModelsInternal(annotationModel.Nodes.Select(x => x.GUID)); - // Add all grouped AnnotaionModels to the CutGeometryDictionary. + // Add all grouped AnnotationModels to the CutGeometryDictionary. // And raise ZIndex changed to make sure nested groups have // a higher zIndex than the parent. using (NestedGroupsGeometries.DeferCollectionReset())