Advanced Live Tiles, Part 3: Lock Screens: Listing 3

The SendTile_Click event handler.

private void SendTile_Click(object sender, RoutedEventArgs e)
{
    string tile = (String.Format("<tile><visual><binding template=\"TileWideText01\">" +
              "<text id=\"1\">{0}</text>" +
              "<text id=\"2\"> </text>" +
            "</binding>" +
            "<binding template=\"TileSquareText03\">" +
              "<text id=\"1\">{0}</text>" +
              "<text id=\"2\"> </text>" +
            "</binding>" +
          "</visual>" +
        "</tile>", Message.Text));
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(tile);
    TileNotification tileNotification = new TileNotification(xmlDoc);
    TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
    Status.Text = "Lock Screen Tile was sent.";
}

About the Author

Eric Vogel is a Senior Software Developer for Red Cedar Solutions Group in Okemos, Michigan. He is the president of the Greater Lansing User Group for .NET. Eric enjoys learning about software architecture and craftsmanship, and is always looking for ways to create more robust and testable applications. Contact him at [email protected].

comments powered by Disqus

Featured

  • Steve Sanderson Wows Web-Devs with Peek at 'Blazor United' for .NET 8

    "We've started some experiments to combine the advantages of Razor Pages, Blazor Server and Blazor WebAssembly all into one thing."

  • Spring Cloud Azure 5.0 Ships with Updated, Redesigned Documentation

    "We've created a new online resource, Azure for Spring developers, to help Spring developers code, deploy and scale their Spring applications on Azure.

  • What's New in Progress Telerik UI for Blazor, .NET MAUI and WinForms

    The company said its new Progress Developer Tools R1 2023 release includes design and accessibility upgrades, deeper customizations and support for the latest frameworks.

  • Take ChatGPT for a Spin with VS Code Tools

    With ChatGPT being the first "It" tech in the cutting-edge AI space that regular people can play around with, it's no wonder that tools to use it are exploding in the Visual Studio Code Marketplace.