Class ViewModelBase
Base view model for all MVC-Based windows in the Simplic UI Framework
Inheritance
Inherited Members
Namespace: Simplic.UI.MVC
Assembly: Simplic.UI.dll
Syntax
public class ViewModelBase : IViewModelBase, INotifyPropertyChanged, IAsyncViewModel
Constructors
| Improve this Doc View SourceViewModelBase()
Create new model base
Declaration
public ViewModelBase()
Properties
| Improve this Doc View SourceForceSave
get or set a state which indicates if something has changed and needs to be saved. Passes the ForceSave value to the Parent Used by DefaultRibbonWindow to call the OnSave method
Declaration
[Browsable(false)]
public bool ForceSave { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsBusy
Gets or sets whether the view model is processing data
Declaration
[Browsable(false)]
public bool IsBusy { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsDirty
Get/Set wether the values has changed in the current ViewModel instance. The default-value is false
Declaration
[Browsable(false)]
public bool IsDirty { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Parent
gets or sets the parent ViewModel
Declaration
[Browsable(false)]
public IViewModelBase Parent { get; set; }
Property Value
Type | Description |
---|---|
UI.MVC.IViewModelBase |
Methods
| Improve this Doc View SourceOnClose()
Called when DefaultRibbonWindow closes used to clear locks
Declaration
public virtual void OnClose()
PropertySetter<T>(T, Action<T>, Boolean, Boolean, Boolean, String)
Property setter wrapper to set property values and call CustomPropertySetter in one line
Declaration
protected void PropertySetter<T>(T value, Action<T> p, bool setIsDirty = true, bool raisePropertyChanged = true, bool raiseErrorsChanged = true, string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
T | value | Property value |
System.Action<T> | p | Action to execute when setting the property |
System.Boolean | setIsDirty | Whether to set the IsDirty flag to true |
System.Boolean | raisePropertyChanged | |
System.Boolean | raiseErrorsChanged | |
System.String | propertyName | Name of the property |
Type Parameters
Name | Description |
---|---|
T | Type of the property |
RaisePropertyChanged(String)
Raise event for a property which value has changed
Declaration
public void RaisePropertyChanged(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the Property |
Events
| Improve this Doc View SourcePropertyChanged
Event which will be raised if an property has changed (Setter)
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |