6

The ShowInputAsync() returns a string, but I want to get the result, I mean Affirmation or Cancellation, from the Dialog.

jsanalytics
  • 13,058
  • 4
  • 22
  • 43

1 Answers1

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 + "!");
    }

enter image description here

jsanalytics
  • 13,058
  • 4
  • 22
  • 43