C# Класс Catel.MVVM.ManagedViewModel

Represents a managed view model. A managed view model is watched for property changes. As soon as a change occurs in one of the managed view models, all other interested view models are notified of the changes.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddInterestedViewModel ( IViewModel viewModel ) : void

Adds a view model to the list of interested view models for this view model type.

AddViewModelInstance ( IViewModel viewModel ) : void

Adds a view model instance to the list of instances.

ManagedViewModel ( Type viewModelType ) : System

Initializes a new instance of the ManagedViewModel class.

RemoveInterestedViewModel ( IViewModel viewModel ) : void

Removes a view model from the list of interested view models for this view model type.

RemoveViewModelInstance ( IViewModel viewModel ) : void

Removes a view model instance from the list of instances.

Приватные методы

Метод Описание
Clear ( ) : void

Clears all the currently registered view models.

This method should only be called during unit testing.

NotifyViewModelsOfEvent ( IViewModel viewModel, ViewModelEvent viewModelEvent, EventArgs e ) : void

Notifies all interested view models of an event that took place.

OnInterestedViewModelClosedAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Closed event is raised.

OnViewModelCanceledAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Canceled event is raised.

OnViewModelCancelingAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Canceling event is raised.

OnViewModelClosedAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Canceled event is raised.

OnViewModelCommandExecutedAsync ( object sender, Catel.MVVM.CommandExecutedEventArgs e ) : Task

Called when the ViewModelBase.CommandExecuted event is raised.

OnViewModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the PropertyChanged event of the ViewModel instances.

OnViewModelSavedAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Saved event is raised.

OnViewModelSavingAsync ( object sender, EventArgs e ) : Task

Called when the ViewModelBase.Saving event is raised.

Описание методов

AddInterestedViewModel() публичный Метод

Adds a view model to the list of interested view models for this view model type.
The is null.
public AddInterestedViewModel ( IViewModel viewModel ) : void
viewModel IViewModel The view model instance that is interested in changes.
Результат void

AddViewModelInstance() публичный Метод

Adds a view model instance to the list of instances.
The is null. The is not of the right type.
public AddViewModelInstance ( IViewModel viewModel ) : void
viewModel IViewModel The view model instance to add.
Результат void

ManagedViewModel() публичный Метод

Initializes a new instance of the ManagedViewModel class.
The is null.
public ManagedViewModel ( Type viewModelType ) : System
viewModelType System.Type Type of the view model.
Результат System

RemoveInterestedViewModel() публичный Метод

Removes a view model from the list of interested view models for this view model type.
The is null.
public RemoveInterestedViewModel ( IViewModel viewModel ) : void
viewModel IViewModel The view model instance that is interested in changes.
Результат void

RemoveViewModelInstance() публичный Метод

Removes a view model instance from the list of instances.
The is null.
public RemoveViewModelInstance ( IViewModel viewModel ) : void
viewModel IViewModel The view model instance to remove.
Результат void