UWP模态窗口 [英] UWP Modal Window

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

问题描述

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

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

您可以移动此窗口,但是它不在任务栏中,而是模态的.

有人知道该怎么做吗?应该没有那么难,但是我找不到任何东西.

解决方案

正如@Daniel Meixner所说,添加此Mail应用程序的帐户交互功能可能会调用

如果我们使用

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

它们处于不同的过程中,并且具有不同的程序包名称.

因此,我创建了两个应用程序,并使用 LaunchForResult 在这些应用程序之间进行通信,它们的作用类似于系统的Mail应用程序.

如果您只想启动系统的添加帐户"应用程序,则可以参考官方的 解决方案

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天全站免登陆