Class TabItemViewModel<T>
Base class for view models that want to be hosted in a tabbed UI.
Inheritance
Inherited Members
Namespace: Phoenix.Views
Assembly: Phoenix.Abstractions.Views.dll
Syntax
public abstract class TabItemViewModel<T> : ViewModelBase<T>, IViewProvider, IClosingNotification, IViewInitialize where T : TabItemControl
Type Parameters
Name | Description |
---|---|
T | The type of the View this model is for. |
Constructors
View SourceTabItemViewModel(T, IWindowingControl, IEventAggregator, IPhoenixLogger, IServiceProvider)
Initializes a new instance of the TabItemViewModel<T> class.
Declaration
protected TabItemViewModel(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 | The windowing control. |
IEventAggregator | eventAggregator | The event aggregator for the application. |
IPhoenixLogger | logger | The logger for the application. |
System.IServiceProvider | services | The services for the tab. |
TabItemViewModel(T, String, IWindowingControl, IEventAggregator, IPhoenixLogger, IServiceProvider)
Initializes a new instance of the TabItemViewModel<T> class.
Declaration
protected TabItemViewModel(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 | The services for the tab. |
Methods
View SourceFocusView()
Focuses the current view tab control.
Declaration
protected virtual void FocusView()
LogCriticalExceptionOnlyIfTabActive(String, Exception)
Logs an exception object to the logger if the tab is selected or undocked as a Critical severity.
Declaration
protected void LogCriticalExceptionOnlyIfTabActive(string prefix, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix for this exception. |
System.Exception | exception | The exception to log. |
LogExceptionOnlyIfTabActive(String, LogSeverity, Exception)
Logs an exception object to the logger if the tab is selected or undocked.
Declaration
protected void LogExceptionOnlyIfTabActive(string prefix, LogSeverity severity, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix for this exception. |
LogSeverity | severity | The severity level of the exception. |
System.Exception | exception | The exception to log. |
LoglineOnlyIfTabActive(String, LogSeverity, String, Object[])
Logs data to the logger if the tab is selected or undocked and includes a line break at the end.
Declaration
protected void LoglineOnlyIfTabActive(string prefix, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
LogSeverity | severity | The severity level of this entry. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LoglineOnlyIfTabActive(String, Guid, LogSeverity, String, Object[])
Logs data to the logger if the tab is selected or undocked and includes a line break at the end.
Declaration
protected void LoglineOnlyIfTabActive(string prefix, Guid categoryId, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.Guid | categoryId | The id of the category to log to. |
LogSeverity | severity | The severity level of this entry. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LoglineOnlyIfTabActive(String, Guid, String, Object[])
Logs data to the logger if the tab is selected or undocked and includes a line break at the end.
Declaration
protected void LoglineOnlyIfTabActive(string prefix, Guid categoryId, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.Guid | categoryId | The id of the category to log to. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LoglineOnlyIfTabActive(String, String, Object[])
Logs data to the logger if the tab is selected or undocked and includes a line break at the end.
Declaration
protected void LoglineOnlyIfTabActive(string prefix, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LogOnlyIfTabActive(String, LogSeverity, String, Object[])
Logs data to the logger if the tab is selected or undocked.
Declaration
protected void LogOnlyIfTabActive(string prefix, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
LogSeverity | severity | The severity level of this entry. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LogOnlyIfTabActive(String, Guid, LogSeverity, String, Object[])
Logs data to the logger if the tab is selected or undocked.
Declaration
protected void LogOnlyIfTabActive(string prefix, Guid categoryId, LogSeverity severity, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.Guid | categoryId | The id of the category to log to. |
LogSeverity | severity | The severity level of this entry. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LogOnlyIfTabActive(String, Guid, String, Object[])
Logs data to the logger if the tab is selected or undocked.
Declaration
protected void LogOnlyIfTabActive(string prefix, Guid categoryId, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.Guid | categoryId | The id of the category to log to. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
LogOnlyIfTabActive(String, String, Object[])
Logs data to the logger if the tab is selected or undocked.
Declaration
protected void LogOnlyIfTabActive(string prefix, string entry, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to use. |
System.String | entry | The log entry to write out. |
System.Object[] | parameters | Formatting parameters to use with the log entry. |
OnViewChanged(Object, DependencyPropertyChangedEventArgs)
Updates the logger with the active tabs.
Declaration
protected virtual void OnViewChanged(object sender, DependencyPropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The tab being updated. |
System.Windows.DependencyPropertyChangedEventArgs | e | The tab's status (whether or not it is visible). |