Open mgnslndh opened 8 years ago
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.
wowsers.
I already did this. A long time ago. You want to use a StackPositionMonitor (HorizontalPositionMonitor). It's already in action in the demo.
Although I guess the event would still be useful, unless you put a throttle on the StackPositionMonitor
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.
OK cool.
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
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.