User entry in the message field

I am trying to add a custom input field to the messageDialog field, as shown below in the Bing Sports app. However, it looks like you can add commands that are buttons. Any help?

(I work in HTML / JavaScript)

Typically, control over MessageDialog fields is as follows:

var dialogMessage = 'This is the dialog text'; var dialog = new Windows.UI.Popups.MessageDialog( dialogMessage ); dialog.commands.append(new Windows.UI.Popups.UICommand("Button", function (command) { /* Action goes here */ })); dialog.showAsync(); 

As you can see, you can only add the command to the Message dialog as an action button ...

enter image description here

+6
source share
3 answers

I was stuck with the same problem for several days, and after hours of searching, I still could not find anything that allowed me to add an input text field to MessageDialog. Note that I'm fairly new to Windows 8 development, although I have several years of experience with JavaScript.

I'm not sure if this is relevant, but since I need input fields to log in, I came across this blog post from MSDN Blog. He explains the CredentialPicker class, which is somewhat similar to MessageDialog in terms of visual style, but as the name implies, it is only intended to collect user credentials.

If this is not what you are looking for, you can check out the recommendations for using MessageDialog and the quick start guide for MessageDialog , like in the Microsoft Dev Center, if you haven't already. Sorry, I cannot provide both links due to restrictions for new users on StackOverflow.

+4
source

I think you need to create your own MessageDialog box: a field that extends to the entire screen and contains the user input field.

You can start with the following code: http://blog.thomaslebrun.net/2012/03/winjs-a-childwindow-control-to-use-in-your-applications/

0
source

Source: https://habr.com/ru/post/917478/


All Articles