Reputation: 1155
How to add TiltEffect for datepicker and stackpanel with out using listbox??
Upvotes: 1
Views: 2053
Reputation: 14118
Not sure if it will help for your controls, but I found the TiltEffect provided by Microsoft to be helpful: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff941108(v=vs.105).aspx
Upvotes: 0
Reputation: 174
By default, only ListBoxItems
and controls that derive from ButtonBase
are enabled for the TiltEffect
. You can however add additional types of controls at any time in code (e.g. in your page constructor) by:
TiltEffect.TiltableItems.Add(typeof(StackPanel));
And then in XAML:
<StackPanel toolkit:TiltEffect.IsTiltEnabled="true">
...
More detailed info on the effect and how to extend the supported types can be found here:
http://windowsphonegeek.com/articles/Silverlight-for-WP7-Toolkit-TiltEffect-in-depth
Upvotes: 11
Reputation: 70162
I was not happy with the Silverlight toolkit tilt effect, especially the way that it is'magically' applied to elements based on type. So I wrote an alternative. You can also configure how much 'tilt' you want to apply. The sourcecode can be found here:
Metro in Motion Part #4: Tilt Effect
You can then individually apply tile to elements as follows:
<Button local:MetroInMotion.Tilt="6"/>
Where the integer specifies how much tilt to apply. I would recommend using quite low values, the native effect is quite subtle, however people tend to make it far too extreme in their own silerlight applications, Metro effects should be subtle, they should not shout at you!
Upvotes: 5