Mahapps中如何获取ShowInputAsync Dialog的结果
How to get the result of ShowInputAsync Dialog in Mahapps
ShowInputAsync()
returns 一个字符串,但我想从对话框中得到结果,我的意思是确认或取消。
如果是returnsnull,表示用户点击了取消:
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 + "!");
}
ShowInputAsync()
returns 一个字符串,但我想从对话框中得到结果,我的意思是确认或取消。
如果是returnsnull,表示用户点击了取消:
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 + "!");
}