Adding TextBox in winRT MessageDialog

[亡魂溺海] 提交于 2019-12-23 19:32:14

问题


I'm working in windows 8 store application and I'm trying to popup a dialog to let the user enter information in a textbox for example.

How to do that ?


回答1:


The InputDialog control in WinRT XAML Toolkit does just that. It is basically a Popup control with a TextBox and some buttons. There is a sample for it too. The most basic one does this:

var dialog = new InputDialog();
var result = await dialog.ShowAsync(
    "This is the title",
    "This is the content/message",
    "Option 1",
    "Option 2",
    "Option 3");

The result is the string that is used on the button that was clicked - e.g. "Option 1".




回答2:


Using "Callisto" library, for those kind of custom Dialog box is the best option. Check out this library by elaborating it's Code Samples. Callisto Code Samples.

I really bothered by this problem and found this solution very help full. you can add anything you want in the Custom dialog box.



来源:https://stackoverflow.com/questions/14588952/adding-textbox-in-winrt-messagedialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!