Adding TextBox in winRT MessageDialog

2019-07-01 15:53发布

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 ?

2条回答
手持菜刀,她持情操
2楼-- · 2019-07-01 16:31

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

查看更多
forever°为你锁心
3楼-- · 2019-07-01 16:43

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.

查看更多
登录 后发表回答