Pages

Wednesday, 11 July 2012

Creating a ScaleTransform animation in C# for WinRT/ Metro Apps

I thought this one would be easy as I’ve done Silverlight, WP7 and WPF apps before, but actually took a while and quite a lot of frustration. AS with most WinRT stuff, you can’t just copy and paste XAML and code and expect it to work.I needed this animation to indicate that an item is clickable by providing visual feedback similar to the one provided by the PointerUpThemeAnimation and PointerDownThemeAnimation provided by the Animations library. I had to wrap my clickable items in buttons to meet the ‘also Keyboard only accessible’ requirement, but the buttons Click-event hindered the PointerReleased event so the PointerUpThemeAnimation wouldn’t run. The result was items that would shrink in size when pointer was pressed, but they would not return to their normal state/size when the pointer was released.

Look, this might not be the best way to go about it, but at the moment there isnt so much information, if you google PointerDownThemeAnimation you will only get ten hits) So, as always, please let me know (email or twitter) if you can clean up my code, provide feedback, information or some magical code


Creating a ScaleTransform animation in C# for WinRT/ Metro Apps


Read full article here

No comments:

Post a Comment

Web Informer Button