Freigeben über


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>

Comments

  • Anonymous
    August 18, 2015
    Good information

  • Anonymous
    August 18, 2015
    Any plans for music control integration for lock screen? Any plans for additional apps showing their notification badges on lock screen beyond those allowed by Windows 8? Any plans for additional apps showing detailed statuses on lock screen beyond the one allowed by Windows 8 and 10 RTM?

  • Anonymous
    August 24, 2015
    @Johnathan

  • Music control integration on lock screen could be neat, that's not my team though, so I can't speak towards that.
  • Additional apps? You mean letting more than 7 quick status apps or something? That'd be the lock screen team again.
  • Additional detailed status would be lock screen team again.
  • Anonymous
    September 05, 2015
    Can we schedule badge updates for a future date?

  • Anonymous
    September 05, 2015
    @Onur - I was literally just telling my co-worker that it's weird we don't have scheduled badges just like scheduled tile/toast! I put it on our backlog (keep in mind there's tons of stuff on the backlog). In the meantime, you would just have to use a scheduled background task (I know, those aren't precise and/or frequent enough). If you'd like, please explain the exact scenario you're trying to achieve and we can log those details for future justification of the feature.

  • Anonymous
    September 05, 2015
    @ Andrew: Thanks for the quick response. Basically I would like to show current week of the year in the badge. I could do this without badge, however, I want this info visible in the lock screen too in non detailed mode. Normally I was planning to use a maintenance trigger and schedule tiles once per week. Now that this isn't possible with badges, the only way is to use an hourly time trigger. And this is a huge waste of resources for a tile to be updated once per week.

  • Anonymous
    September 06, 2015
    Agreed. I'll add your scenario to our backlog details. Thanks!

  • Anonymous
    September 06, 2015
    Another question is Can we make badges visible only on the lock screen but not on the live tile? Perhaps on the live tile I would like to show a different representation and on the lock screen show the badge as a summary?

  • Anonymous
    September 07, 2015
    @Onur - Unfortunately no, we don't provide a way to hide the badge from a tile. I've responded to our conversation on the other article.

  • Anonymous
    May 02, 2016
    Hi,Does NotificationsExtensions support this detail locked screen status?

    • Anonymous
      May 03, 2016
      Hey Mary, yep it does! Use the LockDetailedStatus properties on the ToastVisual object. I'll update the article with code snippets using Extensions.