Gorgon
Show / Hide Table of Contents

Class ViewModelInjection<T>

This object is used to inject common host application services into view models as parameters.

Inheritance
object
ViewModelInjection<T>
ContentViewModelInjection
HostedPanelViewModelParameters
SettingsCategoryViewModelParameters
EditorToolViewModelInjection
Implements
IViewModelInjection<T>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Editor.UI.ViewModels
Assembly: Gorgon.Editor.API.dll
Syntax
public class ViewModelInjection<T> : IViewModelInjection<T> where T : IHostServices
Type Parameters
Name Description
T

The type of host services. Must implement IHostServices.

Remarks

When creating view models, developers should pass custom data used for initialization by inheriting this type. For content, settings, etc... or other built in view model types, there are other base classes for the parameters that should be used.

Constructors

| Edit this page View Source

ViewModelInjection(IViewModelInjection<T>)

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

Declaration
protected ViewModelInjection(IViewModelInjection<T> copy)
Parameters
Type Name Description
IViewModelInjection<T> copy

The injection parameter object to copy.

Exceptions
Type Condition
ArgumentNullException

Thrown when the copy parameter is null.

See Also
IHostServices
| Edit this page View Source

ViewModelInjection(T)

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

Declaration
public ViewModelInjection(T hostServices)
Parameters
Type Name Description
T hostServices

The services from the host application.

Exceptions
Type Condition
ArgumentNullException

Thrown when the hostServices parameter is null.

See Also
IHostServices

Properties

| Edit this page View Source

HostServices

Property to return the common services passed from host application.

Declaration
public T HostServices { get; }
Property Value
Type Description
T
See Also
IHostServices

Implements

IViewModelInjection<T>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

IHostServices
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author