Class
SchedulerDialogViewModel

Provides the base logic for SchedulerDialog ViewModels.

Definition

Constructors

SchedulerDialogViewModel(IScheduleViewDialogHost, Func<SchedulerDialogViewModel, bool?, bool>)

Initializes a new instance of the SchedulerDialogViewModel class.

Declaration

cs-api-definition
public SchedulerDialogViewModel(IScheduleViewDialogHost dialogHost, Func<SchedulerDialogViewModel, bool?, bool> confirmDialogClose)

Parameters

dialogHost

IScheduleViewDialogHost

The host for the dialog.

confirmDialogClose

Func<SchedulerDialogViewModel, bool?, bool>

Close callback.

Properties

AdditionalData

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

Declaration

cs-api-definition
public object AdditionalData { get; set; }

Property Value

object

The additional data.

DialogHost

The DialogHost for this ViewModel.

Declaration

cs-api-definition
protected IScheduleViewDialogHost DialogHost { get; }

Property Value

IScheduleViewDialogHost

Methods

CanConfirm()

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

Declaration

cs-api-definition
protected virtual bool CanConfirm()

Returns

bool

Returns whether the changes can be confirmed.

Cancel()

Cancels the operation.

Declaration

cs-api-definition
public void Cancel()

Confirm()

Executed confirmation logic if can confirm.

Declaration

cs-api-definition
public void Confirm()

DoWithViewModel<T>(object, Action<T>)

Executes an action and uses SchedulerDialogViewModel as parameter.

Declaration

cs-api-definition
protected static void DoWithViewModel<T>(object sender, Action<T> action) where T : SchedulerDialogViewModel

Parameters

sender

object

The SchedulerDialog sender.

action

Action<T>

Action to execute.

OnCancelled(EventArgs)

Fires Cancelled event.

Declaration

cs-api-definition
protected virtual void OnCancelled(EventArgs eventArgs)

Parameters

eventArgs

EventArgs

The event args used for firing the event.

OnConfirmed(EventArgs)

Confirms the changes on the ScheduleDialogViewModel.

Declaration

cs-api-definition
protected virtual void OnConfirmed(EventArgs eventArgs)

Parameters

eventArgs

EventArgs

RegisterCommand(ICommand, ExecutedRoutedEventHandler, CanExecuteRoutedEventHandler)

Registers a class command binding using the CommandBinding class.

Declaration

cs-api-definition
protected static void RegisterCommand(ICommand command, ExecutedRoutedEventHandler executed, CanExecuteRoutedEventHandler canExecute)

Parameters

command

ICommand

The command.

executed

ExecutedRoutedEventHandler

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

canExecute

CanExecuteRoutedEventHandler

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

Events

Cancelled

Occurs when the dialog changes are canceled.

Declaration

cs-api-definition
public event EventHandler Cancelled

Event Value

EventHandler

Confirmed

Occurs when the dialog changes are confirmed.

Declaration

cs-api-definition
public event EventHandler Confirmed

Event Value

EventHandler