Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP Modal Window

I want to show a modal window on the screen in my Universal Windows Platform app (C#), just like the standard Mail-app does when you add an account. Or when you're signing in to a service (like facebook) in an app.

Windows mail app with modal window: Windows 10 mail app - Add account screen

You can move this window around, but it's not in the taskbar and it is modal.

Does anyone know how to do this? It shouldn't be so hard but i can't find anything about it.

like image 518
patrick Avatar asked Dec 19 '22 20:12

patrick


2 Answers

As @Daniel Meixner said, adding account interaction of this Mail app is calling another app possible with LaunchForResults.

Using Task Manager of system, you can see that, when you launch this Mail app, it starts a process with the app's name "Mail", and when you add an account from this app, it starts another process with the app's name "Email and accounts".

enter image description here

If we use the Process Explorer to check on these processes, the Mail app's process is this: enter image description here

and the add account process is this: enter image description here

They are in different processes and have different package names.

So I created two apps and use LaunchForResult for communication between these apps, they act just like the Mail app of system. enter image description here

If you just want to launch the system's "add account" app, you can refer to the official UserDataAccountManager sample.

like image 130
panda Avatar answered Dec 21 '22 08:12

panda


In the mail app what's happening might be app to app communication with "LaunchForResults" - I'm not sure, but it looks like that.

With Windows 10 Universal Apps you can make one app call another app with LaunchForResults. The called app will always behave like a modal dialog to the calling app. You can pass any serializable objects in both directions using ValueSets.

Details for LaunchForResult can be found here: https://msdn.microsoft.com/en-us/library/windows/apps/mt269386.aspx

like image 34
Daniel Meixner Avatar answered Dec 21 '22 09:12

Daniel Meixner