Skip to content

Commit

Permalink
Resolved an issue where selecting a node did not deselect connections…
Browse files Browse the repository at this point in the history
… and vice versa
  • Loading branch information
miroiu committed Jan 4, 2025
1 parent 746615c commit 927bf0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
> - Breaking Changes:
> - Features:
> - Bugfixes:
> - Resolved an issue where selecting a node did not deselect connections and vice versa
#### **Version 7.0.0**

Expand Down
14 changes: 14 additions & 0 deletions Nodify/Connections/ConnectionsMultiSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ private bool CanSelectMultipleItemsBase
set => base.CanSelectMultipleItems = value;
}

/// <summary>
/// Gets the <see cref="NodifyEditor"/> that owns this <see cref="ConnectionsMultiSelector"/>.
/// </summary>
public NodifyEditor? Editor { get; private set; }

protected override DependencyObject GetContainerForItemOverride()
=> new ConnectionContainer(this);

Expand All @@ -66,6 +71,15 @@ public void Select(ConnectionContainer container)
#endif

EndUpdateSelectedItems();

Editor?.UnselectAll();
}

public override void OnApplyTemplate()
{
base.OnApplyTemplate();

Editor = this.GetParentOfType<NodifyEditor>();
}

#region Selection Handlers
Expand Down
2 changes: 2 additions & 0 deletions Nodify/Editor/NodifyEditor.Selecting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ public void Select(ItemContainer container)
selected.Clear();
selected.Add(container.DataContext);
EndUpdateSelectedItems();

UnselectAllConnections();
}

/// <summary>
Expand Down

0 comments on commit 927bf0e

Please sign in to comment.