Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WinRTLiveTileManager

  • 4 minutes to read

Important

The WinRTLiveTileManager component is compatible only with Windows 8 and Windows 8.1

#Online Video

#Concepts

The WinRTLiveTileManager component allows you to create Windows Forms applications that are fully compatible with the Microsoft Windows 8 OS. Use this component in your Windows Forms application to create Live Tile(s) for this app within the Windows 8 Start Screen.

WinRTLiveTileManager - Start Screen

The WinRTLiveTileManager component requires a separate DevExpress Live Tile Manager Windows Store application to be installed on machines of end-users. You can also install it on your machine for debug purposes. The DevExpress Live Tile Manager app can be easily found in the Microsoft Windows Store. This application serves as a bridge between the WinRTLiveTileManager WinForms component and the Windows 8 Start Screen. For end-users, this app provides a UI allowing them to pin and unpin Live Tiles created via the WinRTLiveTileManager component to/from the Windows 8 Start Screen:

WinRTLiveTileManager - Live Tile Manager

A Live Tile consists of the following visual elements:

WinRTLiveTileManager - Tile

#Getting Started

To use the WinRTLiveTileManager control, open your existing Windows Forms project, locate the WinRTLiveTileManager component in the Visual Studio toolbox and drop it onto the application form.

WinRTLiveTileManager - Toolbox Component

Assign the ContainerControl object that hosts the WinForms app (app module) to the WinRTLiveTileManager.ContainerControl property, to assosiate this app (module) with the WinRTLiveTileManager component. You can also specify the WinRTLiveTileManager.ApplicationName property to set the application name displayed within a corresponding Live Tile.

WinRTLiveTileManager - Properties

If you launch the application, and then switch to the DevExpress Live Tile Manager Windows Store app, you will see a Tile. This Tile can be pinned to the Windows 8 Start Screen, but it is static and not actually a ‘Live’ Tile yet. Live Tiles display real-time notifications related to the current application state when the application is running but not focused. To display these notifications, use the WinRTLiveTileManager.UpdateTile method. This method takes the WideTile and SquareTile objects as parameters. These objects contain Tile Templates for large and regular size Tiles respectively. The following code illustrates an example:

WideTile myWideTile = WideTile.CreateTileWideText03("Sample Tile");
SquareTile mySquareTile = SquareTile.CreateTileSquareBlock("14", "April");
winRTLiveTileManager1.UpdateTile(myWideTile, mySquareTile);

Note

All methods that create tiles are named after the corresponding tile templates mentioned above. You can refer to the Tile Template Catalog article, and use the corresponding methods to create a Tile of the desired type.

The image below illustrates an example of both Wide and Square Tile Templates, created via code above.

WinRTLiveTileManager - Sample tiles

If you use a WideTile template for your Live Tile, you can pass null to the WinRTLiveTileManager.UpdateTile method instead of a SquareTile. But it’s strongly recommended to pass both a WideTile and SquareTile objects when updating a Live Tile, because an end-user can manually resize a Tile by standard Windows 8 means (to do so, right-click a Live Tile to select it and clich the ‘Larger’ or ‘Smaller’ option from the Apps bar below).

WinRTLiveTileManager - Resising Tiles

You can optionally update a Live Tile’s Badge when updating its content. The following code sets a ‘New Message’ badge for a Tile:

winRTLiveTileManager1.UpdateBadge(WinRTLiveTileManager.BadgeGlyphTypes.newMessage);

If your application has multiple modules, each of them containing a WinRTLiveTileManager component, and multiple Live Tiles are pinned to the Windows 8 Start Screen, you can get the Tile that an end-user clicked. To do so, call the WinRTLiveTileManager.InitializeNavigation method and handle the WinRTLiveTileManager.OnNavigated event, as shown below.

public Form1() {
     InitializeComponent();
     WinRTLiveTileManager.InitializeNavigation();
     WinRTLiveTileManager.OnNavigated += WinRTLiveTileManager_OnNavigated;
     . . .
 }

 void WinRTLiveTileManager_OnNavigated(string obj) {
     //do something
 }

The obj parameter returns the related WinRTLiveTileManager ID (the WinRTLiveTileManager.Id property), so you can check the ID and get the Live Tile that was clicked. The ID for each WinRTLiveTileManager is generated automatically and cannot be modified.