-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use node suggestion API in node autocomplete UI #11132
Changes from all commits
4e1fe92
062fb99
fcb7503
e7dd7cd
dffcd22
b188015
745547b
0cbe2ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,11 @@ namespace Dynamo.ViewModels | |
/// </summary> | ||
public class NodeAutoCompleteSearchViewModel : SearchViewModel | ||
{ | ||
internal PortViewModel targetPortViewModel { get; set; } | ||
internal PortViewModel PortViewModel { get; set; } | ||
|
||
internal NodeAutoCompleteSearchViewModel(DynamoViewModel dynamoViewModel) : base(dynamoViewModel) | ||
{ | ||
InitializeDefaultAutoCompleteCandidates(); | ||
//InitializeDefaultAutoCompleteCandidates(); | ||
} | ||
|
||
internal void InitializeDefaultAutoCompleteCandidates() | ||
|
@@ -32,5 +32,16 @@ internal void InitializeDefaultAutoCompleteCandidates() | |
} | ||
FilteredResults = candidates; | ||
} | ||
|
||
internal void PopulateAutoCompleteCandidates() | ||
{ | ||
var searchElements = PortViewModel.GetMatchingNodes(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for moving it. But I was hoping we can move all of the code from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't moved the code yet. Doing so now. |
||
FilteredResults = searchElements.Select(e => | ||
{ | ||
var vm = new NodeSearchElementViewModel(e, this); | ||
vm.RequestBitmapSource += SearchViewModelRequestBitmapSource; | ||
return vm; | ||
}); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to consider returning the number of filtered results in
PopulateAutoCompleteCandidates()
, if the number is 0 which means we failed to find any match, then we still callInitializeDefaultAutoCompleteCandidates()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I commented this out was I noticed issues with this. On a mouse up, the node suggestion list was reverting to this default list each time.