I'm trying to add a custom user input field in a messageDialog box, like the one below in the Bing Sports app. However, it seems you can only add mands, which are buttons. Any help?
(I'm working in HTML/JavaScript)
Normally, control over messageDialog boxes appears as follows:
var dialogMessage = 'This is the dialog text';
var dialog = new Windows.UI.Popups.MessageDialog( dialogMessage );
dialogmands.append(new Windows.UI.Popups.UICommand("Button", function (mand) {
/* Action goes here */
}));
dialog.showAsync();
As you can see, you can only append a mand to the dialogMessage, in the form of an actionable button...
I'm trying to add a custom user input field in a messageDialog box, like the one below in the Bing Sports app. However, it seems you can only add mands, which are buttons. Any help?
(I'm working in HTML/JavaScript)
Normally, control over messageDialog boxes appears as follows:
var dialogMessage = 'This is the dialog text';
var dialog = new Windows.UI.Popups.MessageDialog( dialogMessage );
dialog.mands.append(new Windows.UI.Popups.UICommand("Button", function (mand) {
/* Action goes here */
}));
dialog.showAsync();
As you can see, you can only append a mand to the dialogMessage, in the form of an actionable button...
Share Improve this question edited Jun 6, 2012 at 19:08 romeboards asked Jun 6, 2012 at 18:51 romeboardsromeboards 3976 silver badges19 bronze badges 4- oops, forgot to add that. Javascript – romeboards Commented Jun 6, 2012 at 18:55
- Sorry, but I'm confused, could you please explain what you mean by "However, it seems you can only add mands, which are buttons"? – Lennart Commented Jun 6, 2012 at 19:00
- yes... what do you mean a mand? are you trying to add a close function? – Jamie Hutber Commented Jun 6, 2012 at 19:39
- I mean that the only things you can use to define the messageDialog are two strings- one for the title, one for the content, and then you can add "mands," which are the actionable buttons (In the photo, the two mands are Add and Close). What I want is to be able to add the text input field next to the mands, for which there seems to be no option... – romeboards Commented Jun 6, 2012 at 19:51
3 Answers
Reset to default 4I've been stuck with the same problem for a few days now, and after hours of searching I still haven't found anything that lets you add an input text field to your MessageDialog. Note that I am fairly new to Windows 8 development, though I do have a few years of JavaScript experience.
I'm not sure if this is relevant, but since I wanted the input fields for a login, I came across this blog post from MSDN's blog. It explains the CredentialPicker class which is somewhat similar to the MessageDialog in terms of visual style, but as the name implies, it's only for collecting credentials from the user.
If this is not what you're looking for, you could check out the guidelines for usage of MessageDialog and the quickstart guide for MessageDialog, both on Microsoft's Dev Center, if you haven't already. I'm sorry I can't provide both the links due to restrictions on new users on StackOverflow.
I think you'll need to create your own MessageDialog box: a box that expand on all the screen and which contains user input box.
You can start with the following code: http://blog.thomaslebrun/2012/03/winjs-a-childwindow-control-to-use-in-your-applications/
You need to use Popup class http://msdn.microsoft./en-us/library/windows/apps/xaml/hh872190.aspx
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745230093a4617638.html
评论列表(0条)