public void CalendarDialogClosingEventHandler(object sender, DialogClosingEventArgs eventArgs) { if (!Equals(eventArgs.Parameter, "1")) { return; } if (!Calendar.SelectedDate.HasValue) { eventArgs.Cancel(); return; } ((PickersViewModel)DataContext).Date = Calendar.SelectedDate.Value; }
private void ExtendedClosingEventHandler(object sender, DialogClosingEventArgs eventArgs) { if ((bool)eventArgs.Parameter == false) { return; } //OK, lets cancel the close... eventArgs.Cancel(); //...now, lets update the "session" with some new content! eventArgs.Session.UpdateContent(new SampleProgressDialog()); //note, you can also grab the session when the dialog opens via the DialogOpenedEventHandler //lets run a fake operation for 3 seconds then close this baby. Task.Delay(TimeSpan.FromSeconds(3)) .ContinueWith((t, _) => eventArgs.Session.Close(false), null, TaskScheduler.FromCurrentSynchronizationContext()); }