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

Add drag events to DragablzItemsControl #82

Open
mgnslndh opened this issue Feb 6, 2016 · 6 comments
Open

Add drag events to DragablzItemsControl #82

mgnslndh opened this issue Feb 6, 2016 · 6 comments

Comments

@mgnslndh
Copy link
Contributor

mgnslndh commented Feb 6, 2016

It would be nice to have drag events on the DragablzItemsControl so that you can use "event-to-command" binding in MVVM scenarios and let the view model get notified.

Today I have to use AddHandler on the view to add a routed event handler and manually invoke the command on the view.

In my specific scenario I use the control to order items by dragging them in the desired order. I am interested in the DragCompleted event so that I can commit the order of items to their view models.

@ButchersBoy
Copy link
Owner

Currently we have the PositionMonitor which allows communication back to view models without having to use the said pattern (.Interactivity, or whatever).

I will expand this t provide more information. Currently it gives "real time" X,Y updates, but I can also add an event for when a drag operation completes.

@ButchersBoy
Copy link
Owner

wowsers.

I already did this. A long time ago. You want to use a StackPositionMonitor (HorizontalPositionMonitor). It's already in action in the demo.

@ButchersBoy
Copy link
Owner

Although I guess the event would still be useful, unless you put a throttle on the StackPositionMonitor

@mgnslndh
Copy link
Contributor Author

mgnslndh commented Feb 9, 2016

Yes, I am using the HorizontalPositionMonitor but It would be nice if it provided notification of the order when the drag is complete in a separate event.

The current implementation allows me to indicate when the user is reordering items but I also want to know when the drag is complete which means the order is set and should be updated to some other items.

reorder

@ButchersBoy
Copy link
Owner

OK cool.

@sekulicb
Copy link

sekulicb commented May 24, 2017

Is this handled ? Just asking because i need to implement it too. By the way how did you manage to implement HorizontalPositionMonitor? In my project I crate instance of this class and listen for OrderChanged event but that event never fires...what I am doing wrong? Thanks

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

No branches or pull requests

3 participants