UWP 模式窗口 [英] UWP Modal Window

查看:14
本文介绍了UWP 模式窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的通用 Windows 平台应用程序 (C#) 的屏幕上显示一个模式窗口,就像添加帐户时标准邮件应用程序所做的那样.或者当您在应用中登录服务(如 Facebook)时.

带有模态窗口的 Windows 邮件应用程序:

你可以移动这个窗口,但它不在任务栏中,它是模态的.

有人知道怎么做吗?它不应该那么难,但我找不到任何关于它的信息.

解决方案

正如@Daniel Meixner 所说,添加此邮件应用程序的帐户交互正在调用另一个可能使用

如果我们使用

和添加帐户的过程是这样的:

它们在不同的进程中并且具有不同的包名称.

所以我创建了两个应用程序并使用 LaunchForResult 在这些应用程序之间进行通信,它们就像系统的邮件应用程序一样.

如果只是想启动系统的添加账号"应用,可以参考官方UserDataAccountManager 示例.

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:

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.

解决方案

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".

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

and the add account process is this:

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.

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

这篇关于UWP 模式窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆