如果返回 null ,则表示用户点击取消:
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 + "!");
}