I have this code for creation of secondary tile:
var logo = new Uri( "ms-appx:///Assets/Square150x150Logo.png" );
var tile = new SecondaryTile( "TileID", "Tile Text", "ActivateChange", logo, TileSize.Default );
await tile.RequestCreateAsync();
then I have code in my App's OnLaunched(LaunchActivatedEventArgs args) for checking if App was launched with "ActivateChange" arguments:
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
if (!string.IsNullOrEmpty(args.Arguments) && args.Arguments == "ActivateChange")
{
//Doing some work
this.Exit();
return;
}
...
The problem is that when I click on secondary tile then splash screen appears, after it dissappears then it does some of my work and after that it exits the app.
What I would like for it to do is that when I click on secondary tile it will trigger some background task asociated with my App and this background task will do some of my work and then changes its state to sleeping or exits. I don't know how they work. I just know that I can have background task that is running all the time and triggers periodically on some time. But can I have background task that is somehow sleeping and can be triggered from secondary tile?
Thanks!