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

Drag multiple ListBox items #117

Closed
IncPlusPlus opened this issue Feb 11, 2023 Discussed in #109 · 0 comments
Closed

Drag multiple ListBox items #117

IncPlusPlus opened this issue Feb 11, 2023 Discussed in #109 · 0 comments

Comments

@IncPlusPlus
Copy link

IncPlusPlus commented Feb 11, 2023


Discussed in #109

Originally posted by IncPlusPlus September 13, 2022
Hi there. Thanks for making such an awesome library. I was searching around trying to find out how to make an item draggable in Avalonia and almost gave up until I found this. I've figured out how to make a single ListBox item draggable. However, my SelectionMode is set to multiple so multiple items can be selected. When I select multiple items and then start to drag, all items except the one I started the drag action on get deselected. Is there a way to make dragging respect the existing selection of items in a ListBox?

I tried removing the drag & drop behavior and discovered that this issue seems to be with Avalonia specifically. If I start making a dragging motion, the selection is cleared.


I made a discussion post a few months ago asking about this. As far as I can tell, dragging multiple items in a ListBox with SelectionMode="Multiple" is not possible. I've created this issue as an enhancement request.

Is it possible that support could be added for this scenario in the future? If not, do you know of a way I could avoid this issue? I was thinking maybe there was a way to stop the ListBoxItem from getting the PointerPressedEvent until it was followed by a PointerReleasedEvent && no drag had occurred. However, I'm not quite familiar enough with Avalonia to pull it off.

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

No branches or pull requests

2 participants