public async Task ShowToastAsync(string content, TimeSpan duration, ToastType level = ToastType.Info) { if (!CanToast) { return; } ToastMessage message = new ToastMessage() { Content = content, Level = level }; toaster.SetCurrentValue(Toaster.MessageProperty, message); toaster.SetCurrentValue(Toaster.IsActiveProperty, true); var durationWaitHandle = new ManualResetEvent(false); StartDuration(duration, durationWaitHandle); await WaitForCompletionAsync(durationWaitHandle); toaster.SetCurrentValue(Toaster.IsActiveProperty, false); await Task.Delay(toaster.DeactivateStoryboardDuration); toaster.SetCurrentValue(Toaster.MessageProperty, null); durationWaitHandle.Dispose(); }