I am wondering what is the best way to allow a user to input text into a MessageDialog in a Windows 10 universal app.(Forgot password system). From the research I\'ve done this
I use such function to request text from user:
private async Task InputTextDialogAsync(string title)
{
TextBox inputTextBox = new TextBox();
inputTextBox.AcceptsReturn = false;
inputTextBox.Height = 32;
ContentDialog dialog = new ContentDialog();
dialog.Content = inputTextBox;
dialog.Title = title;
dialog.IsSecondaryButtonEnabled = true;
dialog.PrimaryButtonText = "Ok";
dialog.SecondaryButtonText = "Cancel";
if (await dialog.ShowAsync() == ContentDialogResult.Primary)
return inputTextBox.Text;
else
return "";
}
and its usage:
string text = await InputTextDialogAsync("Title");