Show / Hide Table of Contents

Class ViewModelBase<T>

Base class for all exported view models.

Inheritance
System.Object
ViewModelBase<T>
DeviceConfigViewModel
SettingsControlViewModel
TabItemViewModel<T>
Implements
IViewProvider
IClosingNotification
IViewInitialize
Namespace: Phoenix.Views
Assembly: Phoenix.Abstractions.Views.dll
Syntax
public abstract class ViewModelBase<T> : BindableBase, IViewProvider, IClosingNotification, IViewInitialize where T : FrameworkElement
Type Parameters
Name Description
T

The type of the View this model is for.

Constructors

View Source

ViewModelBase(T, IWindowingControl, IEventAggregator, IPhoenixLogger, IServiceProvider)

Initializes a new instance of the ViewModelBase<T> class.

Declaration
protected ViewModelBase(T view, IWindowingControl windowingControl, IEventAggregator eventAggregator, IPhoenixLogger logger, IServiceProvider services = null)
Parameters
Type Name Description
T view

The view this view model is driving.

IWindowingControl windowingControl
IEventAggregator eventAggregator

The event aggregator for the application.

IPhoenixLogger logger

The logger for the application.

System.IServiceProvider services

The services for the view.

View Source

ViewModelBase(T, String, IWindowingControl, IEventAggregator, IPhoenixLogger, IServiceProvider)

Initializes a new instance of the ViewModelBase<T> class.

Declaration
protected ViewModelBase(T view, string headerName, IWindowingControl windowingControl, IEventAggregator eventAggregator, IPhoenixLogger logger, IServiceProvider services = null)
Parameters
Type Name Description
T view

The view this view model is driving.

System.String headerName

The name of the view for display in the window manager.

IWindowingControl windowingControl
IEventAggregator eventAggregator

The event aggregator for the application.

IPhoenixLogger logger

The logger for the application.

System.IServiceProvider services

Properties

View Source

EventAggregator

Gets the event aggregator for this view model.

Declaration
protected IEventAggregator EventAggregator { get; }
Property Value
Type Description
IEventAggregator
View Source

HeaderName

Gets or sets the name of this view for display in the window manager.

Declaration
public string HeaderName { get; set; }
Property Value
Type Description
System.String
View Source

IsClosable

Gets or sets a value indicating whether the view can be closed by the user.

Declaration
public bool IsClosable { get; set; }
Property Value
Type Description
System.Boolean
View Source

IsDockable

Gets or sets a value indicating whether the window can be docked and undocked by the user.

Declaration
public bool IsDockable { get; protected set; }
Property Value
Type Description
System.Boolean
View Source

Logger

Gets the logger for this view model.

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

View

Gets the view this view model is backing.

Declaration
public T View { get; }
Property Value
Type Description
T

Methods

View Source

CloseView()

Closes this view using the window manager.

Declaration
protected void CloseView()
View Source

Closing(CancelEventArgs)

Called when the IClosingListener is closing.

Declaration
public void Closing(CancelEventArgs eventArgs)
Parameters
Type Name Description
System.ComponentModel.CancelEventArgs eventArgs

A System.ComponentModel.CancelEventArgs that contains the event data.

View Source

Initialize()

Allows derived classes to initialize after imports are satisfied.

Declaration
protected virtual void Initialize()
View Source

OnClosed()

Called when the IClosingListener is closed.

Declaration
protected virtual void OnClosed()
View Source

OnClosing(CancelEventArgs)

Called when the IClosingListener is closing.

Declaration
protected virtual void OnClosing(CancelEventArgs e)
Parameters
Type Name Description
System.ComponentModel.CancelEventArgs e

A System.ComponentModel.CancelEventArgs that contains the event data.

View Source

Uninitialize()

Allows derived classes to uninitialize before the view is closed.

Declaration
protected virtual void Uninitialize()

Events

View Source

Closed

Occurs when the view model is closed.

Declaration
public event EventHandler Closed
Event Type
Type Description
System.EventHandler

Explicit Interface Implementations

View Source

IClosingNotification.Closed(EventArgs)

Called when the IClosingListener is closed.

Declaration
void IClosingNotification.Closed(EventArgs e)
Parameters
Type Name Description
System.EventArgs e
View Source

IViewInitialize.Initialize()

Declaration
void IViewInitialize.Initialize()
View Source

IViewInitialize.Uninitialize()

Declaration
void IViewInitialize.Uninitialize()
View Source

IViewProvider.View

Gets the view for this view provider.

Declaration
FrameworkElement IViewProvider.View { get; }
Returns
Type Description
System.Windows.FrameworkElement

Implements

IViewProvider
IClosingNotification
IViewInitialize
  • View Source
In This Article
Back to top Generated by DocFX