Detailed lock screen status for Windows 10

Users can pick one app to display a detailed status on their lock screen, displaying up to three strings of text. By default, the Calendar app is selected, which tells users where their next event is, but other apps like Mail (displaying newest email) and more can benefit from displaying information on the lock screen.

In order to display detailed status on the lock screen, you (the app developer) need to do the following...

  1. Enable detailed lock screen for your tile (primary or secondary)
  2. Send a tile notification with a wide tile binding that contains text for the lock screen

After step 1, the user can go to their lock screen settings and select your app as their detailed status app.

Step 1: Enabling detailed lock screen

Both primary and secondary tiles can be added to the user's lock screen. A secondary tile needs to remain pinned to Start in order to appear on their lock screen (if they unpin it, it'll also be removed from the lock screen). Primary tiles, however, are always implicitly pinned and will remain on their lock screen even if the primary tile isn't currently pinned to their Start screen.

Enabling on primary Tile

In your app's Package.appxmanifest file, add the uap:LockScreen element and set both the BadgeLogo and Notification as seen below. This enables your app to be selected for both quick status and detailed status.

Package.appxmanifest

 <Package ...>
  ...
  <Applications>
    <Application ...>
      <uap:VisualElements ...>
        ...
        <uap:LockScreen BadgeLogo="Assets\SmallLogo.png" Notification="badgeAndTileText"/>
        
      </uap:VisualElements>
      ...
    </Application>
  </Applications>
  ...
</Package>

Enabling on secondary Tile

When pinning a secondary tile (or updating it), make sure to set the following properties to flag your tile as lock screen capable, and as detailed status capable...

Application Code

 // Allows the secondary Tile to be added to lock screen
tile.LockScreenBadgeLogo = new Uri("ms-appx:///Assets/LockLogo.png");

// Allows the secondary Tile to be selected for detailed lock status
tile.LockScreenDisplayBadgeAndTileText = true;

Step 2: Sending tile notification with detailed status text

The detailed status text is taken from your wide tile's notification text. Thus, you have to send a binding for a wide tile size. For more information on sending a tile notification, see Quickstart: Sending a tile notification.

We highly recommend that you use the NuGet package, Microsoft.Toolkit.Uwp.Notifications, which provides an object-oriented data structure for constructing your notifications.

With Microsoft.Toolkit.Uwp.Notifications, all you have to do is set the LockDetailedStatus properties on the ToastVisual class. The Notifications library automatically figures out whether it can re-use any existing text elements from your payload, or if it has to use the hint-* attributes, ensuring that the most efficient XML is produced.

Note: You must include a TileWide binding when using the LockDetailedStatus properties.

 
TileContent content = new TileContent()
{
    Visual = new TileVisual()
    {
        LockDetailedStatus1 = "Meeting with Thomas",
        LockDetailedStatus2 = "11:00 AM - 12:30 PM",
        LockDetailedStatus3 = "Studio F",

        TileWide = new TileBinding() { ... },
        ... (other sizes omitted for brevity)
    }
};

Alternative option: Raw XML

In your notification XML, there are two ways you can specify your detailed status text. You can re-use your wide tile's text elements for the detailed status text, or you can use hint attributes so that your detailed status text has completely different text than your wide tile's content.

Note: These values need to be specified on your wide tile's binding content. Any values specified on small, medium, or large will be ignored.

Raw XML: Using text id's for detailed status text

If the text you're already displaying on your wide tile can also be used for the lock screen detailed status, this option is the ideal choice, since it will help reduce the size of your payload (you are only specifying the text once instead of twice).

Inside the <binding> element for your wide tile content, specify id's for text elements that you want to be displayed on the 1, 2, and 3 slots of the lock screen's default status section, as seen in the example below.

Note: The <text> elements must be immediate children of the <binding> element. Any text elements that are children of groups/subgroups will be ignored. In those cases, use the hint attributes instead.

Tile Notification XML Payload

 <tile><br>  <visual><br><br>    ... (other binding sizes omitted)<br><br>    <binding template="TileWide"><br>      <br>      <text id="1">Meeting with Thomas</text><br>      <text id="2" hint-style="captionSubtle">11:00 AM - 12:30 PM</text><br>      <text id="3" hint-style="captionSubtle">Studio F</text><br>      <br>    </binding><br><br>  </visual><br></tile>

Raw XML: Using hint attributes for detailed status text

Use this option if you require displaying different text on the lock screen than you display on your wide tile.

On the <binding> element for your wide tile content, you can use the three following attributes to control the three lines of text, as seen in the example below. If you only need two lines of text, simply specify the first two.

Tile Notification XML Payload

 <tile><br>  <visual><br><br>    ... (other binding sizes omitted)<br><br>    <binding template="TileWide"<br>             hint-lockDetailedStatus1="Meeting with Thomas"<br>             hint-lockDetailedStatus2="11:00 AM - 12:30 PM"<br>             hint-lockDetailedStatus3="Studio F"><br>      <br>      ... (tile content omitted)<br>      <br>    </binding><br><br>  </visual><br></tile>