Search code examples
windows-store-appsmicrosoft-metrouielement

Fire UIElement Manipulation(Delta) in code behind


I'm building a windows store app and I need to trigger the Manipulation(Delta) of an UIElement in code behind, but don't manage to do so. The idea is that the user can pick an UIElement from the TopAppBar and drag it on the MainGrid (where there is made a copy of that UIElement) and position it as he pleases on the MainGrid.

How it works: In the app the user can drag (with Manipulation) an UIElement(x) from the TopAppBar and when it exites the TopAppBar, a new UIElement(y) is placed on the MainGrid of your Page and the TopAppBar is closed. The new UIElement(y) is positioned so that the pointer is in the center of it.

The user should now be able to keep dragging (with Manipulation) the UIElement, but therefore I need to trigger the Manipulation of the new UIElement(y).

I tried to subscribe to the ManipulationStarting event and then trigger the eventhandler, but as I suspected, it failed.

Any ideas?


Solution

  • Someone answered the question on the msdn support forum. It seems that it is impossible to start Manipulation from the code behind.