c# - Handling a Jump List event when a file is picked from the "Recent" list of files for a UWP Windows 10 app -


i'm working on uwp windows 10 app in c#/xaml, , i'm planning extend use of jump list.

so, know how handle custom jump list tasks (such new file, open file etc.), files in used list, i've no idea @ how intercept file has been selected list (been unable find documentation it, whereas jump list tasks able to).

if pick file when app isn't open, splash screen stays open. , if pick 1 when app open, puts focus on app (obviously desired behaviour doesn't happen in scenario because i'm not handling event).

this easy figure out, if there way me debug app after i've launched via jump list file (or if there app event called when app isn't in focus , return focus selecting jump list file - maybe there i'm not aware of it).

any guidance appreciated!

jump list activation

you need override onfileactivated event in app.xaml.cs. splash screen stays displayed , nothing happens because in event handler, need check if app has been launched or not , in case not, have create root frame , activate window onlaunched handler.

the signature of onfileactivated event

void onfileactivated(fileactivatedeventargs args) 

fileactivatedeventargs contains property files, list of files (storagefiles) used launch app. in case of file activation , jump list activation, initialized appropriately.

debugging app when not launched

this useful tip - can start debugging , wait until app launched. set breakpoint in onfileactivated method, go uwp app project properties in solution explorer, go debug tab , check do not launch, debug code when starts.

now start debugging usual, app not launch , debugger wait until launch manually (using jump list example) , attach it.

debugging when launched

you can use kinds of activation debugging, thing remember.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -