-
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
Proposal: Make TreeView.SelectedItem a DependencyProperty #2458
Comments
I am all for this proposal, I spent quite a few minutes trying to understand why my binding was not working until I found out it is not in fact a dependency property 😀 |
Yes, this should definitely be a DP in my opinion. |
Yes please |
@MikeHillberg graciously offered to do the spec work for this. Thanks! @dpaulino/@chingucoding, would one of you be able to create a PR ? |
@chingucoding unfortunately don't have bandwidth this week. Please feel free to take this Marcel |
Right, will do. Thanks. |
While we are at it, should |
SelectedItem is definitely useful as a dependency property so that it can be bound. I'm not sure if there is much use making SelectedNode a dependency property. I might be wrong. |
I really like your open source spirit. I had a similar issue with WPF a few years ago. But I would never have thought of reporting this. I would not have even known where. And here it was solved in less than two weeks. Thank you very much! |
As I reported under another issue, I tried to upgrade to the recent stable release 2.5.0, and discovered that @ranjeshj, @StephenLPeters and @MikeHillberg - can you tell why it's still in preview and when it might get moved out of preview? This is critical for us, since we'd be stuck with using a pre-release version, which has its own set of issues. |
I'm not sure why it wasn't included in the 2.5 release. I'll talk to the team, maybe we can include this in a later patch to the 2.5 release. No promises though. |
The spec is already updated. @chingucoding can you move this API out of preview ? Thanks! |
Sure, I'll create a PR shortly. |
Proposal: Make
TreeView.SelectedItem
aDependencyProperty
Summary
The TreeView.SelectedItem property is not a DP, hence it is not possible to bind to the view model with the
TwoWay
mode.Rationale
One common pattern for a list or tree view is the master detail pattern. The user selects an item from an items view (
ListView
,ComboBox
,ListBox
,TreeView
etc.) and in a secondary view more details for the given item are presented, for example the body of an email, the content of a directory or the article of an rss feed. In order for the view model to retrieve the selected email from the server, it must know if and which email was selected in the list/tree.In most, if not all, other items controls, the
SelectedItem
property is infact aDependencyProperty
.The text was updated successfully, but these errors were encountered: