Answered by:
Tilt effect for controls on pressed/tapped

Question
-
On the Start Screen the tiles tilt when you interact with them. Is this effect supported in the controls we devs use, and if so, how do you implement it.
http://www.mdtadesign.co.uk/
- Moved by Rob Caplan [MSFT]Microsoft employee, Moderator Thursday, March 1, 2012 6:05 PM (From:UI Design for Metro style apps)
Thursday, March 1, 2012 5:06 PM
Answers
-
Well thank you for all your advice and help.
Turns out there is an in built way to achieve this. I was exploring through the ListView templates to figure out why the ListBox did not have the pressed/tapped affect. On the "Pressed" visual state, a Theme animation is defined, and this matches the rest of the OS.
<TapDownThemeAnimation TargetName="ContentPresenter"/>
And this can be placed in the Visual State Storyboard.
<VisualState x:Name="Pressed"> <Storyboard> <TapDownThemeAnimation TargetName="ContentPresenter"/> </Storyboard> </VisualState>
http://www.mdtadesign.co.uk/
- Marked as answer by mdtadesign Monday, March 5, 2012 2:48 PM
Monday, March 5, 2012 2:48 PM
All replies
-
You could port the TiltEffect from the WinPhone toolkit: http://silverlight.codeplex.com/SourceControl/changeset/view/71382#1510301
Here's my quick'n'dirty port: http://pastebin.com/aDj3RwQk (could probably use some tweaks and cleanup, but it seems to work fairly well)
- Proposed as answer by Morten NielsenMVP Thursday, March 1, 2012 6:33 PM
- Edited by Morten NielsenMVP Thursday, March 1, 2012 6:37 PM
Thursday, March 1, 2012 5:51 PM -
Which UI environment are you using (HTML? Xaml/C#? Xaml/C++?) so we can get this into the right forum. You can get this effect for your own controls in the Consumer Preview, but the details will depend on which language you are using.
--Rob
Thursday, March 1, 2012 6:00 PMModerator -
I think its important for this information to be put out there for all languages, but I plan to develop UI in XAML, with C# (same as Windows Phone)
http://www.mdtadesign.co.uk/
Thursday, March 1, 2012 6:02 PM -
Made this into a blogpost as well: http://www.sharpgis.net/post/2012/03/02/TiltEffect-for-Windows-8-Metro-XAML.aspx
- Proposed as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Saturday, March 3, 2012 3:43 AM
Saturday, March 3, 2012 3:25 AM -
Thanks Morten,
Mdtadesign, also take a look at the documentation 3-D effects for Metro style apps using XAML for an overview of the pieces used to build the effect.
--Rob
- Proposed as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Saturday, March 3, 2012 3:43 AM
Saturday, March 3, 2012 3:43 AMModerator -
Well thank you for all your advice and help.
Turns out there is an in built way to achieve this. I was exploring through the ListView templates to figure out why the ListBox did not have the pressed/tapped affect. On the "Pressed" visual state, a Theme animation is defined, and this matches the rest of the OS.
<TapDownThemeAnimation TargetName="ContentPresenter"/>
And this can be placed in the Visual State Storyboard.
<VisualState x:Name="Pressed"> <Storyboard> <TapDownThemeAnimation TargetName="ContentPresenter"/> </Storyboard> </VisualState>
http://www.mdtadesign.co.uk/
- Marked as answer by mdtadesign Monday, March 5, 2012 2:48 PM
Monday, March 5, 2012 2:48 PM -
Awesome find! I totally missed that. I should probably update my blogpost.Monday, March 5, 2012 9:19 PM
-
I have built an extension that allows you to easily apply these same transitions without having to edit visual states. All you have to do is add:
Controls:TapBehaviourExtension.TapBehavour="On"
to your object.
Full details, and a sample are on my blog:
http://www.olsonsoft.com/blogs/stefanolson/post/WinRT-Tapped-Behaviour.aspx
...Stefan
Wednesday, May 2, 2012 5:02 AM -
TapDownThemeAnimation has been renamed to PointerDownThemeAnimation in the Release Preview (according to this post).
Just sayin' for future reference =).
Joakim Rosendahl Consultant at OnTrax AB, Sweden.
Thursday, June 14, 2012 8:35 AM