-
Notifications
You must be signed in to change notification settings - Fork 710
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
Make TreeView SelectedItem a DP #2523
Make TreeView SelectedItem a DP #2523
Conversation
dev/TreeView/TreeView.cpp
Outdated
@@ -292,6 +292,29 @@ void TreeView::OnListControlSelectionChanged(const winrt::IInspectable& sender, | |||
if (SelectionMode() == winrt::TreeViewSelectionMode::Single) | |||
{ | |||
RaiseSelectionChanged(args.AddedItems(), args.RemovedItems()); | |||
|
|||
const auto newSelectedItem = [this,args]() { |
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.
this [](start = 38, length = 4)
Is the this capture needed here?
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.
No it wasn't needed, removed it.
dev/TreeView/TreeView.cpp
Outdated
// Checking if new value is different to the currently internally selected item | ||
if (args.NewValue() != selected) | ||
{ | ||
if (auto listControl = ListControl()) |
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.
auto [](start = 16, length = 4)
nit: const
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.
Fixed
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Description
Makes the SelectedItem a DP and adds interaction test to verify two way binding.
Motivation and Context
Closes #2458
How Has This Been Tested?
Add new interaction test
Screenshots (if appropriate):