Windows does not provide a way to determine the tile content when a user launches the app via a tile. Per the UX guidelines launching from each of the following should have the corresponding behavior:
- Main tile: The app should launch to the last place the user left the app or the app home page.
- Secondary tile: The app should launch to specific content in the app.
- Toast: Like a secondary tile, the app should launch to specific content in the app.
All three of types of activation will cause the OnActivated
event to be fired with the IActivatedEventArgs.Kind
parameter set to ActivationKind.Launch
.
For both secondary tile and toast activations, the app can provide an additional context in the LaunchActivatedEventArgs.Argument parameter.
For secondary tiles, the launch arguments parameter can be set upon creation of the tile via the SecondaryTile.Arguments
property.
For toast notifications, the launch arguments parameter is set as an attribute in the toast notification XML:
<toast launch="myLaunchContext">
...
</toast>
Lastly, apps should not need to check whether the tile has been turned on or off by the user. Windows and WNS will determine whether delivery is required. The user can turn the tile on/off while an app is not running, so the state saved by the app may be out of sync with the setting.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…