如何在Windows 8的应用程序地铁用户提示对话框? [英] How to have user prompt dialogs in Windows 8 metro apps?

查看:126
本文介绍了如何在Windows 8的应用程序地铁用户提示对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得一些用户输入了我的应用程序,如姓名,出生日期等,从一个模态窗口

为了这个,我需要显示其中将包含文本框和其他控件的对话框。

常在的WinForms / WPF我会创造从Form / Window类继承的类,并使用显示/ ShowDialog方法呈现的形式提供给用户

我如何使用XAML / C#实现在Windows 8地铁应用这种行为?

我已经看过了 Windows下的 MessageDialog 类.UI.Popups 命名空间

,但其显示像经典的MessageBox唯一的消息。

我已经看过另一个 CoreWindowFlyout 类,也不能确定是否可用于我期待的行为。

I would like to get some user inputs for my app like Name, DOB, etc from a modal window
for this I need a dialog to be displayed which would contain the textboxes and other controls.
Normally in WinForms/WPF I would create a class inherited from the Form/Window class and use the Show/ShowDialog method to present the form to the user
How do I achieve this behavior in Windows 8 metro apps using XAML/C# ?
I have looked at the MessageDialog class under the Windows.UI.Popups namespace
but its for showing only message like the classic MessageBox.
I have looked at another CoreWindowFlyout class and also not sure if that can be used for the behavior I am expecting.

推荐答案

您可以简单地创建一个自定义的用户控件与所有需要的投入(如文本框 ES),然后显示它使用的 弹出 类。

You can simply create a custom UserControl with all the required inputs (such as TextBoxes) and then show it using Popup class.

例如:

Popup myPopup = new Popup();
myPopup.Child = new CustomUserControl();
myPopup.IsOpen = true;

这篇关于如何在Windows 8的应用程序地铁用户提示对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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