Class ViewModelBase
A base view model providing logging and telemetry.
Inheritance
ViewModelBase
Implements
Inherited Members
Namespace: Phoenix.BotBrain
Assembly: Phoenix.Plugin.BotBrain.Shared.dll
Syntax
public abstract class ViewModelBase : BindableBase, INotifyPropertyChanged
Constructors
View SourceViewModelBase(IPhoenixLogger)
Initializes a new instance of the ViewModelBase class.
Declaration
protected ViewModelBase(IPhoenixLogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| IPhoenixLogger | logger | The logger. |
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 SourceLogger
Gets the Phoenix logger instance to use.
Declaration
protected IPhoenixLogger Logger { get; }
Property Value
| Type | Description |
|---|---|
| IPhoenixLogger |
Services
Gets the service provider.
Declaration
protected IServiceProvider? Services { get; }
Property Value
| Type | Description |
|---|---|
| IServiceProvider |
TelemetryClient
Gets the telemetry client.
Declaration
protected virtual ITelemetryClient? TelemetryClient { get; }
Property Value
| Type | Description |
|---|---|
| ITelemetryClient |
Methods
View SourceLogVerboseException(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. |