In this previous article I discussed methods using XAML Manipulation Events with gestures to transform your UI, making it interactive. I talked about the different approaches you can use to leverage fingers and mouse.
In this article, I want to show a simple implementation that encapsulates some Manipulation logic into a XAML attached property. Attached properties are one of my favorite things in XAML. They allow developers to extend objects much like extension methods in C#.
Simply set my new attached property called “CanMove” to true, and your UI element can be dragged around the screen like it’s glued to your finger (or mouse). It’s pretty cool.