Show / Hide Table of Contents

Class ViewModelBase

A base view model providing logging and telemetry.

Inheritance
object
BindableBase
ViewModelBase
AutomationViewModelBase
BotViewModelBase
MultiParameterEditorViewModel
DetailsViewModel
BrainLogViewModel
ParameterFactory
Implements
INotifyPropertyChanged
Inherited Members
BindableBase.SetProperty<T>(ref T, T, string)
BindableBase.SetProperty<T>(ref T, T, Action, string)
BindableBase.RaisePropertyChanged(string)
BindableBase.OnPropertyChanged(PropertyChangedEventArgs)
BindableBase.PropertyChanged
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.Shared.dll
Syntax
public abstract class ViewModelBase : BindableBase, INotifyPropertyChanged

Constructors

View Source

ViewModelBase(IPhoenixLogger)

Initializes a new instance of the ViewModelBase class.

Declaration
protected ViewModelBase(IPhoenixLogger logger)
Parameters
Type Name Description
IPhoenixLogger logger

The logger.

View Source

ViewModelBase(IServiceProvider)

Initializes a new instance of the ViewModelBase class.

Declaration
protected ViewModelBase(IServiceProvider serviceProvider)
Parameters
Type Name Description
IServiceProvider serviceProvider

The service provider used to log and send telemetry.

Properties

View Source

Logger

Gets the Phoenix logger instance to use.

Declaration
protected IPhoenixLogger Logger { get; }
Property Value
Type Description
IPhoenixLogger
View Source

Services

Gets the service provider.

Declaration
protected IServiceProvider? Services { get; }
Property Value
Type Description
IServiceProvider
View Source

TelemetryClient

Gets the telemetry client.

Declaration
protected virtual ITelemetryClient? TelemetryClient { get; }
Property Value
Type Description
ITelemetryClient

Methods

View Source

LogVerboseException(Exception, string?, string?)

Logs an exception, and logs its stack trace to the verbose output.

Declaration
protected void LogVerboseException(Exception e, string? message = null, string? prefix = null)
Parameters
Type Name Description
Exception e

The exception.

string message

A message describing the failure to the user.

string prefix

The prefix to log to.

Implements

INotifyPropertyChanged

Extension Methods

INotifyPropertyChangedExtensions.OnPropertyChanged(INotifyPropertyChanged, string, Action)
INotifyPropertyChangedExtensions.OnPropertyChanged(INotifyPropertyChanged, string, Action<object?, string>)
INotifyPropertyChangedExtensions.OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<bool>)
INotifyPropertyChangedExtensions.OnPropertyChangedUntil(INotifyPropertyChanged, string, Func<object?, string, bool>)
  • View Source
In this article
Back to top Generated by DocFX