Convert series of Actions to coroutineasyncreactive methods?

Multi tool use
Multi tool use


Convert series of Actions to coroutineasyncreactive methods?



I'm trying to drag and drop some shapes around a ItemsControl (with a grid for a panel). I can get it working in a basic way by using Message.Attach on the ItemsControl like this, passing $eventArgs or $executionContext as needed, and
storing them in the viewmodel.
(Not storing the actual mouse position, but a Point(row, column))



I would like to have some sort of conditions on the various Actions, ie
don't execute MouseMove unless the mouse button is being held etc.



I would also like to be able to have various restrictions on where the item can be dropped, ie the cell is empty, and won't overlap anything else, etc.



My first idea was a custom SpecialValue, $startDrag, so I could test for the button being held, and pass in the calculated grid position directly, instead of
the raw MouseEventArgs. It's a bit better, as I only need 2 messages (MouseMove + MouseLeftButtonUP) but still not ideal.



There must be a more appropriate way to do something like this.
I was looking at CM's coroutines, and async stuff, and things like reactive, but I have almost no understanding of them, or if they might be appropriate at all.



Any thoughts or suggestions welcome.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

NEo 10ifsZlVbmHUz,qT4SQ0O Uy,2wWy
BCr8ovyUPQp1LUuGnt6c4,T9f1TF9Alm TW5TTB3Vfp,3dStwkvUS10jNcmvrx00yyMEUYdFHH

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications