The ShowInputAsync()
returns a string, but I want to get the result, I mean Affirmation or Cancellation, from the Dialog.
Asked
Active
Viewed 1,836 times
6

jsanalytics
- 13,058
- 4
- 22
- 43

Ragnarokkr Xia
- 187
- 10
1 Answers
7
If it returns null, it means the user hit Cancel:
private async void Button_Click(object sender, RoutedEventArgs e)
{
var result = await this.ShowInputAsync("Test", "Enter string:");
if (result == null)
return;
await this.ShowMessageAsync("Test", "You entered " + result + "!");
}

jsanalytics
- 13,058
- 4
- 22
- 43
-
Problem Solved! Thanks! – Ragnarokkr Xia Feb 27 '17 at 16:00
-
If user do not input anything, then click OK, it also result null. – huang Aug 16 '19 at 00:52