Class ViewModelBase
Represents the base class for Artemis view models
public abstract class ViewModelBase : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, IEnableLogger
- Inheritance
-
objectReactiveObjectViewModelBase
- Implements
-
IReactiveNotifyPropertyChanged<IReactiveObject>IHandleObservableErrorsIReactiveObjectIEnableLogger
- Derived
- Inherited Members
-
ReactiveObject.SuppressChangeNotifications()ReactiveObject.AreChangeNotificationsEnabled()ReactiveObject.DelayChangeNotifications()ReactiveObject.ChangingReactiveObject.ChangedReactiveObject.ThrownExceptionsReactiveObject.PropertyChangingReactiveObject.PropertyChanged
Properties
DisplayName
Gets or sets the display name of the view model
public string? DisplayName { get; set; }
Property Value
Methods
OnPropertyChanged(PropertyChangedEventArgs)
Raises the property changed event for the provided property.
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
Parameters
argsPropertyChangedEventArgsThe event arguments containing the name of the property that changed.
OnPropertyChanging(PropertyChangingEventArgs)
Raises the property changing event for the provided property.
protected virtual void OnPropertyChanging(PropertyChangingEventArgs args)
Parameters
argsPropertyChangingEventArgsThe event arguments containing the name of the property that is changing.
RaiseAndSetIfChanged<TRet>(ref TRet, TRet, string?)
RaiseAndSetIfChanged fully implements a Setter for a read-write property on a ReactiveObject, using CallerMemberName to raise the notification and the ref to the backing field to set the property.
[NotifyPropertyChangedInvocator]
public TRet RaiseAndSetIfChanged<TRet>(ref TRet backingField, TRet newValue, string? propertyName = null)
Parameters
backingFieldTRetA Reference to the backing field for this property.
newValueTRetThe new value.
propertyNamestringThe name of the property, usually automatically provided through the CallerMemberName attribute.
Returns
- TRet
The newly set value, normally discarded.
Type Parameters
TRetThe type of the return value.