New to Telerik UI for WPFStart a free 30-day trial

Provides the base logic for SchedulerDialog ViewModels.

Definition

Constructors

Initializes a new instance of the SchedulerDialogViewModel class.

C#
public SchedulerDialogViewModel(IScheduleViewDialogHost dialogHost, Func<SchedulerDialogViewModel, bool?, bool> confirmDialogClose)
Parameters:dialogHostIScheduleViewDialogHost

The host for the dialog.

confirmDialogCloseFunc<SchedulerDialogViewModel, bool?, bool>

Close callback.

Properties

Gets or sets the additional data set to the view model.

C#
public object AdditionalData { get; set; }
Property Value:

The additional data.

The DialogHost for this ViewModel.

C#
protected IScheduleViewDialogHost DialogHost { get; }

Methods

Cancels the operation.

C#
public void Cancel()

Check whether the changes can be confirmed. The default value is true.

C#
protected virtual bool CanConfirm()
Returns:

bool

Returns whether the changes can be confirmed.

Executed confirmation logic if can confirm.

C#
public void Confirm()

Executes an action and uses SchedulerDialogViewModel as parameter.

C#
protected static void DoWithViewModel<T>(object sender, Action<T> action) where T : SchedulerDialogViewModel
Parameters:senderobject

The SchedulerDialog sender.

actionAction<T>

Action to execute.

Fires Cancelled event.

C#
protected virtual void OnCancelled(EventArgs eventArgs)
Parameters:eventArgsEventArgs

The event args used for firing the event.

Confirms the changes on the ScheduleDialogViewModel.

C#
protected virtual void OnConfirmed(EventArgs eventArgs)
Parameters:eventArgsEventArgs

Registers a class command binding using the CommandBinding class.

C#
protected static void RegisterCommand(ICommand command, ExecutedRoutedEventHandler executed, CanExecuteRoutedEventHandler canExecute)
Parameters:commandICommand

The command.

executedExecutedRoutedEventHandler

The handler for the System.Windows.Input.CommandBinding.Executed event on the command.

canExecuteCanExecuteRoutedEventHandler

The handler for the System.Windows.Input.CommandBinding.CanExecute event on the command.

Events

Occurs when the dialog changes are canceled.

C#
public event EventHandler Cancelled

Occurs when the dialog changes are confirmed.

C#
public event EventHandler Confirmed