Supporting Other Controls

Some controls may benefit from the tilt effect, yet may not necessarily derive from ButtonBase or ListBoxItem. To enable TiltEffect on an alternative UIElement type, such as on context menu items, add the element Type to the TitleEffect’s list of supported types via the TiltEffect.TiltableItems collection.

Tip

As TiltEffect.TiltableItems is a static property and global to your app, where possible populate it from a centralized location such as your App class, rather than in an ad hoc fashion from, for example, your page classes. This can help to reduce duplication, and allows you to manage type registrations in one location.

The following excerpt demonstrates how to add tilt effect support for the Toolkit’s context ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.