private void ShowToast() { Task.Factory.StartNew(() => { Views.Notification notification = null; Dispatcher.Invoke(() => (notification = new Views.Notification()).Show()); Thread.Sleep(TimeSpan.FromSeconds(5)); Dispatcher.Invoke(() => notification.CloseWindow(null, null)); }); }
public Notification(Models.PassBook pb) { noti = new Views.Notification(); noti.txtNoti.Text = "Sổ tiết kiệm " + pb.GetID.ToString() + " đến hạn ngày " + pb.EndDate.ToString("dd/MM/yyyy") + ". Số tiền rút ra trước hạn sẽ được tính lãi theo lãi suất không kì hạn (0.05%/năm). Bạn có muốn tiếp tục không?"; noti.btnNo.Click += (sender, e) => { noti.Close(); }; noti.btnYes.Click += (sender, e) => { flag = true; noti.Close(); }; }