Reputation: 303
The ShowInputAsync()
returns a string, but I want to get the result, I mean Affirmation or Cancellation, from the Dialog.
Upvotes: 6
Views: 1974
Reputation: 13188
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 + "!");
}
Upvotes: 7