Skip to content
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

No reaction on expanding/collapsing item #196

Open
ndikiy opened this issue Jul 25, 2023 · 1 comment · May be fixed by #214
Open

No reaction on expanding/collapsing item #196

ndikiy opened this issue Jul 25, 2023 · 1 comment · May be fixed by #214

Comments

@ndikiy
Copy link

ndikiy commented Jul 25, 2023

I have found an issue related to refreshing tree when item is to be expanded or collapsed initiated from VM layer. Using your demo, particularly Drag/drop tab of your demo, I have added mouse double-click handler to the tree where I try to toggle corresponding item expanded state. So, this handler is working but there is no reaction on changing item expanded state at the View layer until I resized the window so that item goes out of the view and back to the view.

Video of how to reproduce is attached

2023-07-25_10h24_57.mp4
@ndikiy
Copy link
Author

ndikiy commented Jul 25, 2023

Here is the code of mentioned handler:

        private void DragDrop_OnPointerPressed(object? sender, PointerPressedEventArgs e)
        {
            if (e.ClickCount != 2)
                return;

            var row = (e.Source as Control)?.FindAncestorOfType<TreeDataGridRow>();

            if (row?.DataContext is DragDropItem item)
                item.IsExpanded = !item.IsExpanded;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant