Base type for creating your own view model.
More...
|
| ApplicationContext | ApplicationContext [get] |
| | Gets the current ApplicationContext instance.
|
| TimeSpan | BusyTimeout = TimeSpan.FromSeconds(30) [get, set] |
| | Gets or sets a value specifying the timeout when calling SaveAsync and the Model is currently busy with async rules.
|
| T? | Model [get, set] |
| | Gets or sets the Model object.
|
| bool | ManageObjectLifetime = false [get, set] |
| | Gets or sets a value indicating whether the view model should manage the lifetime of the business object, including using n-level undo.
|
| bool | IsBusy = false [get, protected set] |
| | Gets a value indicating whether this object is executing an asynchronous process.
|
| string | ViewModelErrorText = string.Empty [get, protected set] |
| | Gets any error text generated by refresh or save operations.
|
| virtual string | ModelErrorText [get] |
| | Gets the first validation error message from the Model.
|
| Exception? | Exception [get] |
| | Gets the last exception caught by the view model during refresh or save operations.
|
| bool | CanCreateObject [get, protected set] |
| | Gets a value indicating whether the current user is authorized to create an instance of the business domain type.
|
| bool | CanGetObject [get, protected set] |
| | Gets a value indicating whether the current user is authorized to retrieve an instance of the business domain type.
|
| bool | CanEditObject [get, protected set] |
| | Gets a value indicating whether the current user is authorized to edit/save an instance of the business domain type.
|
| bool | CanDeleteObject [get, protected set] |
| | Gets a value indicating whether the current user is authorized to delete an instance of the business domain type.
|
Base type for creating your own view model.
◆ DoCancel()
| virtual void Csla.Blazor.ViewModel< T >.DoCancel |
( |
| ) |
|
|
inlineprotectedvirtual |
Cancels changes made to the model if ManagedObjectLifetime is true.
◆ DoSaveAsync()
| virtual async Task< T?> Csla.Blazor.ViewModel< T >.DoSaveAsync |
( |
ISavable? | cloned | ) |
|
|
inlineprotectedvirtual |
Override to provide custom Model save behavior.
◆ GetPropertyInfo() [1/2]
| IPropertyInfo Csla.Blazor.ViewModel< T >.GetPropertyInfo |
( |
string | propertyName | ) |
|
|
inline |
Get a PropertyInfo object for a property of the Model. PropertyInfo provides access to the meta-state of the property.
- Parameters
-
| propertyName | Property name |
- Exceptions
-
| ArgumentException | propertyName is null, string.Empty or only consists of white spaces. |
| InvalidOperationException | Model is null. |
◆ GetPropertyInfo() [2/2]
| IPropertyInfo Csla.Blazor.ViewModel< T >.GetPropertyInfo |
( |
string | propertyName, |
|
|
string | id ) |
|
inline |
Get a PropertyInfo object for a property of the Model. PropertyInfo provides access to the meta-state of the property.
- Parameters
-
| propertyName | Property name |
| id | Unique identifier for property in list or array |
- Exceptions
-
| ArgumentException | propertyName is null, string.Empty or only consists of white spaces. |
| InvalidOperationException | Model is null. |
◆ GetPropertyInfo< P >() [1/3]
Get a PropertyInfo object for a property. PropertyInfo provides access to the meta-state of the property.
- Parameters
-
| property | Property expression |
- Exceptions
-
| ArgumentNullException | property is null. |
◆ GetPropertyInfo< P >() [2/3]
Get a PropertyInfo object for a property. PropertyInfo provides access to the meta-state of the property.
- Parameters
-
| property | Property expression |
| id | Unique identifier for property in list or array |
- Exceptions
-
| ArgumentNullException | property is null. |
◆ GetPropertyInfo< P >() [3/3]
Get a PropertyInfo object for a property. PropertyInfo provides access to the meta-state of the property.
- Parameters
-
| property | Property expression |
| textSeparator | text seprator for concatenating errors |
- Exceptions
-
| ArgumentNullException | textSeparator or property is null. |
◆ OnModelChanged()
| virtual void Csla.Blazor.ViewModel< T >.OnModelChanged |
( |
| ) |
|
|
inlineprotectedvirtual |
Raises the ModelChanged event.
◆ OnModelChanging()
| virtual void Csla.Blazor.ViewModel< T >.OnModelChanging |
( |
T? | oldValue, |
|
|
T? | newValue ) |
|
inlineprotectedvirtual |
Raises the ModelChanging event.
- Parameters
-
| oldValue | Old Model value |
| newValue | New Model value |
◆ OnModelChildChanged()
Raises the ModelChildChanged event.
- Parameters
-
◆ OnModelCollectionChanged()
| virtual void Csla.Blazor.ViewModel< T >.OnModelCollectionChanged |
( |
object? | sender, |
|
|
NotifyCollectionChangedEventArgs | e ) |
|
inlineprotectedvirtual |
Raises the ModelCollectionChanged event.
- Parameters
-
◆ OnModelPropertyChanged()
| virtual void Csla.Blazor.ViewModel< T >.OnModelPropertyChanged |
( |
object? | sender, |
|
|
PropertyChangedEventArgs | e ) |
|
inlineprotectedvirtual |
Raises the ModelPropertyChanged event.
- Parameters
-
◆ RefreshAsync()
| async Task< T?> Csla.Blazor.ViewModel< T >.RefreshAsync |
( |
Func< Task< T?> > | factory | ) |
|
|
inline |
Refresh the Model.
- Parameters
-
| factory | Async data portal or factory method |
- Exceptions
-
| ArgumentNullException | factory is null. |
◆ SaveAsync() [1/2]
| async Task Csla.Blazor.ViewModel< T >.SaveAsync |
( |
| ) |
|
|
inline |
Saves the Model asynchronously.
◆ SaveAsync() [2/2]
| async Task Csla.Blazor.ViewModel< T >.SaveAsync |
( |
CancellationToken | ct | ) |
|
|
inline |
Saves the Model.
- Parameters
-
| ct | The cancellation token. |
◆ UnhookChangedEvents()
| void Csla.Blazor.ViewModel< T >.UnhookChangedEvents |
( |
T? | model | ) |
|
|
inlineprotected |
Unhooks changed event handlers from the model.
- Parameters
-
◆ ViewModel()
Creates an instance of the type.
- Parameters
-
- Exceptions
-
| ArgumentNullException | applicationContext is null. |
◆ ApplicationContext
| ApplicationContext Csla.Blazor.ViewModel< T >.ApplicationContext |
|
getprotected |
◆ BusyTimeout
| TimeSpan Csla.Blazor.ViewModel< T >.BusyTimeout = TimeSpan.FromSeconds(30) |
|
getset |
Gets or sets a value specifying the timeout when calling SaveAsync and the Model is currently busy with async rules.
◆ CanCreateObject
| bool Csla.Blazor.ViewModel< T >.CanCreateObject |
|
getprotected set |
Gets a value indicating whether the current user is authorized to create an instance of the business domain type.
◆ CanDeleteObject
| bool Csla.Blazor.ViewModel< T >.CanDeleteObject |
|
getprotected set |
Gets a value indicating whether the current user is authorized to delete an instance of the business domain type.
◆ CanEditObject
| bool Csla.Blazor.ViewModel< T >.CanEditObject |
|
getprotected set |
Gets a value indicating whether the current user is authorized to edit/save an instance of the business domain type.
◆ CanGetObject
| bool Csla.Blazor.ViewModel< T >.CanGetObject |
|
getprotected set |
Gets a value indicating whether the current user is authorized to retrieve an instance of the business domain type.
◆ Exception
| Exception? Csla.Blazor.ViewModel< T >.Exception |
|
get |
Gets the last exception caught by the view model during refresh or save operations.
◆ IsBusy
| bool Csla.Blazor.ViewModel< T >.IsBusy = false |
|
getprotected set |
Gets a value indicating whether this object is executing an asynchronous process.
◆ ManageObjectLifetime
| bool Csla.Blazor.ViewModel< T >.ManageObjectLifetime = false |
|
getset |
Gets or sets a value indicating whether the view model should manage the lifetime of the business object, including using n-level undo.
◆ Model
| T? Csla.Blazor.ViewModel< T >.Model |
|
getset |
Gets or sets the Model object.
◆ ModelErrorText
| virtual string Csla.Blazor.ViewModel< T >.ModelErrorText |
|
getprotected |
Gets the first validation error message from the Model.
◆ ViewModelErrorText
| string Csla.Blazor.ViewModel< T >.ViewModelErrorText = string.Empty |
|
getprotected set |
Gets any error text generated by refresh or save operations.
◆ Error
Event raised when failed to save Model.
◆ ModelChanged
| Action? Csla.Blazor.ViewModel< T >.ModelChanged |
Event raised when Model has changed.
◆ ModelChanging
| Action<T?, T?>? Csla.Blazor.ViewModel< T >.ModelChanging |
Event raised when Model is changing.
◆ ModelChildChanged
Event raised when the Model object raises its ModelChildChanged event.
◆ ModelCollectionChanged
| Action<object, NotifyCollectionChangedEventArgs>? Csla.Blazor.ViewModel< T >.ModelCollectionChanged |
Event raised when the Model object raises its ModelCollectionChanged event.
◆ ModelPropertyChanged
| PropertyChangedEventHandler? Csla.Blazor.ViewModel< T >.ModelPropertyChanged |
Event raised when the Model object raises its PropertyChanged event.
◆ Saved
| Action? Csla.Blazor.ViewModel< T >.Saved |
Event raised after Model has been saved.
The documentation for this class was generated from the following file: