private void FreezeInternalFocus(object sender, ShowDialogEventArgs args) { if (!args.Cancel) { _internalFreezeFocused = true; } }
private void classSchedule_ShowDialog(object sender, ShowDialogEventArgs e) { if (e.DialogViewModel is AppointmentDialogViewModel) { e.Cancel = true; } }
private void RadScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e) { if (e.DialogViewModel is AppointmentDialogViewModel && _cancelAppointmentEditing) { e.Cancel = true; _cancelAppointmentEditing = false; // Set true after editing Calencar Note to prevent showing Edit Appointment window } }
public void RaiseDialogRequested(ShowDialogEventArgs e) { var handler = DialogRequest; if (handler != null) { handler(this, e); } }
private void AssociatedObject_ShowDialog(object sender, ShowDialogEventArgs e) { var viewModel = (e.DialogViewModel as AppointmentDialogViewModel); if (viewModel != null) { e.Cancel = true; } }
/// <summary> /// Create and display a dialog of a given type, setting owner</summary> /// <typeparam name="T">Dialog type</typeparam> /// <param name="owner">Dialog owner</param> /// <param name="e">ShowDialogEventArgs specifying dialog view model</param> public static void CreateAndShowChildDialog <T>(this Window owner, ShowDialogEventArgs e) where T : Window { Requires.NotNull(e, "e"); T dlg = Activator.CreateInstance <T>(); dlg.DataContext = e.ViewModel; dlg.Owner = owner; e.DialogResult = dlg.ShowDialog(); }
private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e) { var viewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel; if (viewModel != null) { if (viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Dragging || viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Resizing) { var scheduleView = sender as RadScheduleView; destinationSlot = scheduleView.HighlightedSlots[0] as Slot; } } }
private void AssociatedObject_ShowDialog(object sender, ShowDialogEventArgs e) { var viewModel = (e.DialogViewModel as AppointmentDialogViewModel); if (viewModel != null && viewModel.ViewMode == AppointmentViewMode.Edit) { e.Cancel = !AllowEditing; if (DoubleClickAppointmentCommand != null && DoubleClickAppointmentCommand.CanExecute(viewModel.Occurrence.Appointment)) { DoubleClickAppointmentCommand.Execute(viewModel.Occurrence.Appointment); } } }
private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e) { var viewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel; if (viewModel != null) { if (viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Dragging) { var scheduleView = sender as RadScheduleView; destinationSlot = scheduleView.HighlightedSlots[0] as Slot; } } }
private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e) { if (e.DialogViewModel is AppointmentDialogViewModel) { e.Cancel = true; if (Properties.Settings.Default.Role != "Support Staff" && Properties.Settings.Default.Role != "Employee") { if (scheduleView.SelectedSlot != null) { Slot selectedSlot = scheduleView.SelectedSlot; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedSlot, this); addSchd.ShowDialog(); } else if (scheduleView.SelectedAppointment != null) { IOccurrence sel = scheduleView.SelectedAppointment; Appointment selectedAppt = sel as Appointment; UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedAppt, this); addSchd.ShowDialog(); } } } if (e.DialogViewModel is ConfirmDialogViewModel) { e.DefaultDialogResult = false; e.Cancel = true; } var dialogViewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel; if (dialogViewModel != null) { dialogViewModel.IsSeriesModeSelected = true; } }
public IEnumerable<IResult> SchedulerShowDialog(object sender, ShowDialogEventArgs e) { IAppointment showApp = null; // Stops double locking attempts, this method can be fired twice depending on type of appointment bool isLockRequired = (this.SchedulerEditingId.IsNull() ? Guid.Empty : this.SchedulerEditingId) == Guid.Empty; this.schedulerDialogViewModelHandle = e.DialogViewModel; if (this.schedulerDialogViewModelHandle is RecurrenceChoiceDialogViewModel) { RecurrenceChoiceDialogViewModel svm = e.DialogViewModel as RecurrenceChoiceDialogViewModel; showApp = (AppAppointment)svm.Occurrence.Master; if (!((AppAppointment)showApp).IsReadOnly) { SchedulerEditingId = Guid.Parse(((AppAppointment)svm.Occurrence.Master).UniqueId.ToString()); } } if (e.DialogViewModel is AppointmentDialogViewModel) { AppointmentDialogViewModel avm = e.DialogViewModel as AppointmentDialogViewModel; showApp = (AppAppointment)avm.Occurrence.Master; if (!((AppAppointment)showApp).IsReadOnly) { if (!((AppAppointment)showApp).IsNew) if (((AppAppointment)showApp).OriginalMasterId.IsNotNull()) { SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).OriginalMasterId.ToString()); }else { SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).UniqueId.ToString()); } else SchedulerEditingId = Guid.Empty; } } if (e.DialogViewModel is ConfirmDialogViewModel) { var record = e.DialogViewModel as ConfirmDialogViewModel; showApp = (AppAppointment)record.Appointments.Select(x => x).FirstOrDefault(); if (showApp != null) { if (((AppAppointment)showApp).IsReadOnly) { e.DefaultDialogResult = true; e.Cancel = true; }else { SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).UniqueId.ToString()); } } } if (this.SchedulerEditingId != Guid.Empty && isLockRequired) { this.SchedulerIsBusy = true; GetLockRequest lockAppointment = new GetLockRequest(ModelNamesEnum.Appointment, SchedulerEditingId.ToString()); yield return lockAppointment; if (lockAppointment.Error != null) { yield return new HandleExceptionResult(lockAppointment.Error); ((AppAppointment)showApp).IsReadOnly = true; this.SchedulerIsBusy = false; this.SchedulerEditingId = Guid.Empty; yield break; } if (!lockAppointment.Result) { ((AppAppointment)showApp).IsReadOnly = true; GetUserRequest getUserRequest = new GetUserRequest(lockAppointment.UserId); yield return getUserRequest; this.SchedulerIsBusy = false; LastSchedulerMessage = AppLib.GetLockMessage(getUserRequest.Result); var lockedDialog = UILib.DialogOk(LastSchedulerMessage, "Record In Use", "../Resources/Images/Locked.png"); yield return lockedDialog; this.SchedulerEditingId = Guid.Empty; yield break; } this.SchedulerIsBusy = false; } yield break; }
private void OnShowDialog(object sender, ShowDialogEventArgs e) { var additionalData = new ParentsInfo { Parents = this.ViewModel.Parents }; e.DialogViewModel.AdditionalData = additionalData; }
private void FreezeInternalFocus( object sender, ShowDialogEventArgs args ) { if ( !args.Cancel ) { _internalFreezeFocused = true; } }
private void ScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e) { e.Cancel = true; }
/// <summary> /// 付款计划日程控件弹出子窗体句柄 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void PaymentScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e) { var schedule = sender as RadScheduleView; if (schedule == null) { return; } if (e.DialogViewModel is AppointmentDialogViewModel) { var viewModel = e.DialogViewModel as AppointmentDialogViewModel; if (viewModel.ViewMode == AppointmentViewMode.Edit) { var appointment = schedule.EditedAppointment as PaymentAppointment; if (appointment != null) { appointment.EditRecurrenceDialog = false; } return; } } if (e.DialogViewModel is RecurrenceDialogViewModel) { var viewModel = e.DialogViewModel as RecurrenceDialogViewModel; viewModel.RecurrenceRangeType = RecurrenceRangeType.RepeatUntil; } }