Table of Contents

Class ViewModelBase

Namespace
Artemis.UI.Shared
Assembly
Artemis.UI.Shared.dll

Represents the base class for Artemis view models

public abstract class ViewModelBase : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, IEnableLogger
Inheritance
object
ReactiveObject
ViewModelBase
Implements
IReactiveNotifyPropertyChanged<IReactiveObject>
IHandleObservableErrors
IReactiveObject
IEnableLogger
Derived
Inherited Members
ReactiveObject.SuppressChangeNotifications()
ReactiveObject.AreChangeNotificationsEnabled()
ReactiveObject.DelayChangeNotifications()
ReactiveObject.Changing
ReactiveObject.Changed
ReactiveObject.ThrownExceptions
ReactiveObject.PropertyChanging
ReactiveObject.PropertyChanged

Properties

DisplayName

Gets or sets the display name of the view model

public string? DisplayName { get; set; }

Property Value

string

Methods

OnPropertyChanged(PropertyChangedEventArgs)

Raises the property changed event for the provided property.

protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)

Parameters

args PropertyChangedEventArgs

The 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

args PropertyChangingEventArgs

The 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

backingField TRet

A Reference to the backing field for this property.

newValue TRet

The new value.

propertyName string

The name of the property, usually automatically provided through the CallerMemberName attribute.

Returns

TRet

The newly set value, normally discarded.

Type Parameters

TRet

The type of the return value.