TiltEffect in Silverlight for Windows Phone Toolkit can produce an oblique effect on the Applied Control token, so that users can know more clearly that there is a definite choice, however, TiltEffect does not support all the control roles if it is not set in the Toolkit. For example, if it is directly applied to the HubTile in the Toolkit, it will not be effective, however, because Tile like the first line of a Windows Phone has this oblique effect when it is selected, therefore, users may have the same effect when selecting HubTile. Therefore, there is still a simple method to apply TiltEffect to HubTile, produce the same user experience as the original mobile phone.
Next, add a class and inherit from the Grid, and add it to TiltableItems.
Using System. Windows. Controls;
Using Microsoft. Phone. Controls;
Namespace TilteffectTest
{
Public class Tiltable: Grid
{
}
Public partial class MainPage: PhoneApplicationPage
{
Public MainPage ()
{
InitializeComponent ();
TiltEffect. TiltableItems. Add (typeof (Tiltable ));
}
After namespace is added in XAML, it can be directly applied to HubTile. At this time, when Tile is selected, the oblique effect will be generated, this is consistent with the Tile in the Windows Phone System.
<Phone: PhoneApplicationPage
Xmlns: my = "clr-namespace: TilteffectTest"
...>
......
<Grid x: Name = "ContentPanel" Grid. Row = "1" Margin = "12,0, 12,0">
<My: Tiltable>
<Toolkit: HubTile toolkit: TiltEffect. IsTiltEnabled = "True"/>
</My: Tiltable>
</Grid>
</Phone: PhoneApplicationPage>
}
}
Thank you for your solution! But a problem is found! Reply at a.m. on February 11
# Re: [WP] apply TiltEffect oblique effects on HubTile
If you navigate back to another page, the effect of clicking HubTile will be incorrect. I thought it was back and didn't execute the constructor, so I triedTiltEffect.TiltableItems.Add(
typeof
(Tiltable); Code is added to the PageLoaded event and cannot be resolved. Then I tried to set
My: Tiltable. I don't know why? Consult ~