Is it possible to implement a custom Transition in WinRT? E.g. it would be nice to have transitions for the control visibility. So when you show/hide a part of a split view it animates the entire view by using a sliding effect.
Yes you can, using the usual WPF animation techniques, only with minor changes to WinRT.
The usual pattern is to apply double/color/easing animations to your UI elements via storyboarding - being triggered by changes in the visual state manager. You can do this either declaratively or via code-behind.
http://www.codeproject.com/Articles/23257/Beginner-s-WPF-Animation-Tutorial
http://blogs.msdn.com/b/wpfsdk/archive/2009/02/27/the-visualstatemanager-and-triggers.aspx
As far as I know you can't build your custom transitions and use them like normal WinRT Transitions, that is, inside a TransitionCollection.
<ListView.Transitions>
<TransitionCollection>
<myTransitions:PotatoeTransition/>
</TransitionCollection>
</ListView.Transitions>
You can't do the above as far as I know. (ignore the fact that I exemplified with a ListView, it applies to everything, I think)
You'll probably have to use a Storyboard that animates both the RenderTransform (TranslateTransform) and the Opacity to achieve your objective.
I think you can still create a Behavior though if you want to make it more reusable.
© 2022 - 2024 — McMap. All rights reserved.