我想使用MahApps创建以下类似的逻辑:
ShowScreenCommand = new Command(async () =>
{
var window = Application.Current.MainWindow as MetroWindow;
if (await window.ShowMessageAsync("Are you sure to remove it?", "Removal", MessageDialogStyle.AffirmativeAndNegative) == MessageDialogResult.Affirmative)
{
await removePatientTask();
}
});
private async Task removeTask()
{
var window = Application.Current.MainWindow as MetroWindow;
var controller = await window.ShowProgressAsync("Please wait...","Process message",false,new MetroDialogSettings());
await Task.Delay(5000);
await controller.CloseAsync();
}
问题在于,消息对话框和进度对话框之间存在一个间隙。一个对话框隐藏,另一个对话框显示,这看起来并不完美。
有没有办法消除这个间隙?我的意思是,用另一个对话框替换一个对话框?