![]() |
CSLA .NET 10.0.0
A home for your business logic
|
Base class used to create ViewModel objects that implement their own commands/verbs/actions. More...
Public Member Functions | |
| virtual async Task< T?> | RefreshAsync< F > (Func< Task< T?> > factory) |
| Creates or retrieves a new instance of the Model by invoking an action. | |
| virtual async Task< T?> | SaveAsync () |
| Saves the Model, first committing changes if ManagedObjectLifetime is true. | |
Static Public Attributes | |
| static readonly DependencyProperty | ModelProperty |
| Gets or sets the Model object. | |
| static readonly DependencyProperty | ManageObjectLifetimeProperty |
| Gets or sets a value indicating whether the ViewModel should automatically managed the lifetime of the Model. | |
Protected Member Functions | |
| virtual async Task< T?> | DoSaveAsync (ISavable? cloned) |
| Override to provide custom Model save behavior. | |
| virtual void | DoCancel () |
| Cancels changes made to the model if ManagedObjectLifetime is true. | |
| virtual object | DoAddNew () |
| Adds a new item to the Model (if it is a collection). | |
| virtual void | DoRemove (object? item) |
| Removes an item from the Model (if it is a collection). | |
| virtual void | DoDelete () |
| Marks the Model for deletion (if it is an editable root object). | |
| virtual void | OnModelChanged (T? oldValue, T? newValue) |
| Invoked when the Model changes, allowing event handlers to be unhooked from the old object and hooked on the new object. | |
| void | UnhookChangedEvents (T? model) |
| Unhooks changed event handlers from the model. | |
| virtual void | OnSetProperties () |
| Override this method to hook into to logic of setting properties when model is changed or edited. | |
| virtual void | OnPropertyChanged (string propertyName) |
| Raise the PropertyChanged event. | |
Properties | |
| T? | Model [get, set] |
| Gets or sets the Model object. | |
| bool | ManageObjectLifetime [get, set] |
| Gets or sets a value indicating whether the ViewManageObjectLifetime should automatically managed the lifetime of the ManageObjectLifetime. | |
| bool | IsBusy [get, protected set] |
| Gets a value indicating whether this object is executing an asynchronous process. | |
| virtual bool | IsDirty [get, protected set] |
| Gets a value indicating whether the Model has been changed. | |
| virtual bool | IsValid [get, protected set] |
| Gets a value indicating whether the Model is currently valid (has no broken rules). | |
| virtual bool | CanSave [get, protected set] |
| Gets a value indicating whether the Model can currently be saved. | |
| virtual bool | CanCancel [get, protected set] |
| Gets a value indicating whether the Model can currently be canceled. | |
| virtual bool | CanCreate [get, protected set] |
| Gets a value indicating whether an instance of the Model can currently be created. | |
| virtual bool | CanDelete [get, protected set] |
| Gets a value indicating whether the Model can currently be deleted. | |
| virtual bool | CanFetch [get, protected set] |
| Gets a value indicating whether an instance of the Model can currently be retrieved. | |
| virtual bool | CanRemove [get, protected set] |
| Gets a value indicating whether the Model can currently be removed. | |
| virtual bool | CanAddNew [get, protected set] |
| Gets a value indicating whether the Model can currently be added. | |
| virtual bool | CanCreateObject [get, protected set] |
| Gets a value indicating whether the current user is authorized to create a Model. | |
| virtual bool | CanGetObject [get, protected set] |
| Gets a value indicating whether the current user is authorized to retrieve a Model. | |
| virtual bool | CanEditObject [get, protected set] |
| Gets a value indicating whether the current user is authorized to save (insert or update a Model. | |
| virtual bool | CanDeleteObject [get, protected set] |
| Gets a value indicating whether the current user is authorized to delete a Model. | |
Events | |
| PropertyChangedEventHandler? | ModelPropertyChanged |
| Event raised when a property on the Model changes. | |
| Action< object, ChildChangedEventArgs >? | ModelChildChanged |
| Event raised when a child of the Model changes. | |
| Action< object, NotifyCollectionChangedEventArgs >? | ModelCollectionChanged |
| Event raised the Model changes and is a collection. | |
| PropertyChangedEventHandler? | PropertyChanged |
| Event raised when a property changes. | |
Base class used to create ViewModel objects that implement their own commands/verbs/actions.
| T | Type of the Model object. |
|
inlineprotectedvirtual |
Adds a new item to the Model (if it is a collection).
|
inlineprotectedvirtual |
Cancels changes made to the model if ManagedObjectLifetime is true.
|
inlineprotectedvirtual |
Marks the Model for deletion (if it is an editable root object).
|
inlineprotectedvirtual |
Removes an item from the Model (if it is a collection).
|
inlineprotectedvirtual |
Override to provide custom Model save behavior.
|
inlineprotectedvirtual |
Invoked when the Model changes, allowing event handlers to be unhooked from the old object and hooked on the new object.
| oldValue | Previous Model reference. |
| newValue | New Model reference. |
|
inlineprotectedvirtual |
Raise the PropertyChanged event.
| propertyName | Name of the changed property. |
|
inlineprotectedvirtual |
Override this method to hook into to logic of setting properties when model is changed or edited.
|
inlinevirtual |
Creates or retrieves a new instance of the Model by invoking an action.
| factory | Factory method to invoke |
|
inlinevirtual |
Saves the Model, first committing changes if ManagedObjectLifetime is true.
|
inlineprotected |
Unhooks changed event handlers from the model.
| model |
|
static |
Gets or sets a value indicating whether the ViewModel should automatically managed the lifetime of the Model.
|
static |
Gets or sets the Model object.
|
getprotected set |
Gets a value indicating whether the Model can currently be added.
|
getprotected set |
Gets a value indicating whether the Model can currently be canceled.
|
getprotected set |
Gets a value indicating whether an instance of the Model can currently be created.
|
getprotected set |
Gets a value indicating whether the current user is authorized to create a Model.
|
getprotected set |
Gets a value indicating whether the Model can currently be deleted.
|
getprotected set |
Gets a value indicating whether the current user is authorized to delete a Model.
|
getprotected set |
Gets a value indicating whether the current user is authorized to save (insert or update a Model.
|
getprotected set |
Gets a value indicating whether an instance of the Model can currently be retrieved.
|
getprotected set |
Gets a value indicating whether the current user is authorized to retrieve a Model.
|
getprotected set |
Gets a value indicating whether the Model can currently be removed.
|
getprotected set |
Gets a value indicating whether the Model can currently be saved.
|
getprotected set |
Gets a value indicating whether this object is executing an asynchronous process.
|
getprotected set |
Gets a value indicating whether the Model has been changed.
|
getprotected set |
Gets a value indicating whether the Model is currently valid (has no broken rules).
|
getset |
Gets or sets a value indicating whether the ViewManageObjectLifetime should automatically managed the lifetime of the ManageObjectLifetime.
|
getset |
Gets or sets the Model object.
Implements Csla.Xaml.IViewModel.
| Action<object, ChildChangedEventArgs>? Csla.Xaml.ViewModelBase< T >.ModelChildChanged |
Event raised when a child of the Model changes.
| Action<object, NotifyCollectionChangedEventArgs>? Csla.Xaml.ViewModelBase< T >.ModelCollectionChanged |
Event raised the Model changes and is a collection.
| PropertyChangedEventHandler? Csla.Xaml.ViewModelBase< T >.ModelPropertyChanged |
Event raised when a property on the Model changes.
| PropertyChangedEventHandler? Csla.Xaml.ViewModelBase< T >.PropertyChanged |
Event raised when a property changes.