Tiles, Badges, and Toasts

StyleMVVM provides a set of services to handle the above mentioned activities. The intention of the services is to provide a easier to use interface than manipulating XML.

ITileService

The ITileService provides a wrapper around the TileUpdater class as well as providing 41 interfaces that represent the templates microsoft provides here. Below is a code example of how to update your application tile

    using StyleMVVM.Notification.Tile;

    [Import]
    public ITileService TileService { get; set; }

    public void TileUpdateMethod()
    {
        ITileSquareBlock tileUpdate = TileService.CreateTileSquareBlock();
        
        tileUpdate.TextField1 = "Hi";
        tileUpdate.TextField2 = "Blah blah";

        TileService.Update(tileUpdate);
    }

IBadgeService

The IBadgeService wraps the BadgeUpdater class and provides an easy way to update your application badge. You can pdate your badge to one of the predefined glyphs or a number between 1 & 99. Below is a code example of how to update the badge to the Playing Glyph.

    using StyleMVVM.Notification.Badge;

    [Import]
    public IBadgeService BadgeService { get; set; }

    public void BadgeUpdateMethod()
    {
       BadgeService.UdpateGlyph(BadgeGlyph.Playing);
    }

IToastService

The IToastService wraps the ToastNotifier class as well as providing a set of Interfaces that represent a toast update. Below is an example of how to send a toast.

    using StyleMVVM.Notification.Toast;

    [Import]
    public IToastService ToastService { get; set; }

    public void SendToast()
    {
	IToastText01 toast = ToastService.CreateToastText01();

	toast.TextField1 = "Toast Text";

	ToastService.Toast(toast);
    }

Last edited Oct 27, 2012 at 12:38 AM by ipjohnson123, version 6

Comments

No comments yet.