You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 7, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 7, 2022. It is now read-only.
First of all: Thank you for this great project. This ticket is not an issue, in fact it´s a feature request.
It would be nice if there would be an event which triggers when a node has been expanded (and not been selected). So the event should also trigger if the user clicks on the triangle beside the display name. Currently it is only possible to check if a node is expanded or not.
You can bind this view property to your view-model class and react on the property changed. That's how I do it, also for implementing lazy loading of child items. Does that help you or do you need more details?
I use that in my TxEditor application, you can view its source code here. The TreeViewItemViewModel class is a base class for all view models that are used as tree items. It has the IsExpanded property which is bound to the MultiSelectTreeViewItem.IsExpanded property in the MultiSelectTreeView.ItemContainerStyle in the XAML file (go the the "region Tree view"). Whenever the control's expanded state changes, the view model property is updated. You can add your code to the property setter there, like I do here for lazy loading.
It might still be useful to have an expanded event, much like the standard TreeView has.
In the original, it is implemented as a RoutedEvent on the item type which can bubble, and it allows users to set up a centralized event handler for any tree item expanding by adding a TreeViewItem.Expanded attribute on the TreeView element in the XAML.
Activity
ygoe commentedon Feb 7, 2017
You can bind this view property to your view-model class and react on the property changed. That's how I do it, also for implementing lazy loading of child items. Does that help you or do you need more details?
Quantentunnel commentedon Feb 25, 2017
Do you have a link where I can read in this? Thanks a lot!
ygoe commentedon Feb 25, 2017
I use that in my TxEditor application, you can view its source code here. The
TreeViewItemViewModelclass is a base class for all view models that are used as tree items. It has theIsExpandedproperty which is bound to theMultiSelectTreeViewItem.IsExpandedproperty in theMultiSelectTreeView.ItemContainerStylein the XAML file (go the the "region Tree view"). Whenever the control's expanded state changes, the view model property is updated. You can add your code to the property setter there, like I do here for lazy loading.Quantentunnel commentedon Feb 25, 2017
Thank you. I will give it a try.
I will give you feedback if it does not work.
danlyons-home commentedon May 2, 2017
It might still be useful to have an expanded event, much like the standard TreeView has.
In the original, it is implemented as a RoutedEvent on the item type which can bubble, and it allows users to set up a centralized event handler for any tree item expanding by adding a TreeViewItem.Expanded attribute on the TreeView element in the XAML.