DYN-9091: move view to new port and reuse window#16324
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9091
There was a problem hiding this comment.
Pull Request Overview
This PR updates the autocomplete flyout so that it reuses the same window when switching ports instead of recreating it.
- Extracted event subscription/unsubscription into
SubscribeEvents/UnsubscribeEventsin the bar view. - Added
ReloadDataContextto refresh the view model and rebind events on the existing window. - Modified the view extension to cache and reload the bar view instance when already open.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml.cs | Introduced SubscribeEvents/UnsubscribeEvents, wired up ParentNodeRemoved, and added ReloadDataContext to refresh the bar in-place. |
| src/NodeAutoCompleteViewExtension/NodeAutoCompleteViewExtension.cs | Added a field to cache the bar view and updated the request handler to call ReloadDataContext when the window is already open. |
|
So there are a few more aspects to consider for window reusability. As it is now ( reused only when open ) - there are contexts where we can't reuse it - e.g when we are dealing with multiple workspaces a dyn and a custom node open in the same time. Let's address that issue from John and other than that LGTM! Nice to see this working! |
…n.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
johnpierson
left a comment
There was a problem hiding this comment.
lgtm, added task based on @BogdanZavu comment. https://jira.autodesk.com/browse/DYN-9104
Ah, yes, if we close it then it's not reusable either. If we wanted full reusability we'd have to accept that it stays in the visual tree (hidden) once the funcitonality is used, because a |
Purpose
Move autocomplete flyout window to new port and reuse window while still open.
2025-06-25.17-48-00.mp4
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Move autocomplete flyout window to new port and reuse window while still open.
Reviewers
@johnpierson
@BogdanZavu
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of