Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.
This repository was archived by the owner on May 7, 2022. It is now read-only.

Expanded node event #38

Open
Open

Description

@Quantentunnel

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.

Activity

  1. ygoe commented on Feb 7, 2017

    @ygoe
    Owner

    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?

  2. Quantentunnel commented on Feb 25, 2017

    @Quantentunnel
    Author

    Do you have a link where I can read in this? Thanks a lot!

  3. ygoe commented on Feb 25, 2017

    @ygoe
    Owner

    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.

  4. Quantentunnel commented on Feb 25, 2017

    @Quantentunnel
    Author

    Thank you. I will give it a try.
    I will give you feedback if it does not work.

  5. danlyons-home commented on May 2, 2017

    @danlyons-home

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions