Class ViewProviderCollection
Implementation of the IViewProviderCollection service used to register UI view providers with the application.
Inheritance
Implements
Inherited Members
Namespace: Phoenix.WindowManagement
Assembly: Phoenix.Core.dll
Syntax
public class ViewProviderCollection : IViewProviderCollection
Remarks
The AddPhoenixView<TIUniqueViewProvider, TViewProvider, TView>(ViewProviderInfo) that takes in a ViewProviderInfo directly is only used to register system UI (Logging, Device manager) This class is primarily used by the IWindowManager.
Constructors
View SourceViewProviderCollection()
Initializes a new instance of the ViewProviderCollection class.
Declaration
public ViewProviderCollection()
ViewProviderCollection(IServiceCollection)
Initializes a new instance of the ViewProviderCollection class.
Declaration
public ViewProviderCollection(IServiceCollection serviceCollection)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | serviceCollection | The |
Properties
View SourceRequiredViewProviders
Gets the view providers that are required for phoenix and should never be closed.
Declaration
public IEnumerable<ViewProviderInfo> RequiredViewProviders { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ViewProviderInfo> |
TabViewProviders
Gets the view providers for views that are opened in the main phoenix tab control.
Declaration
public IEnumerable<ViewProviderInfo> TabViewProviders { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ViewProviderInfo> |
Methods
View SourceAddDockableTabView<TIUniqueViewProvider, TViewProvider, TView>(String)
Adds a view, that is dockable in the main phoenix tab control, with transient lifetime to the view provider collection.
Declaration
public IViewProviderCollection AddDockableTabView<TIUniqueViewProvider, TViewProvider, TView>(string menuName)
where TIUniqueViewProvider : class, IViewProvider where TViewProvider : class, TIUniqueViewProvider where TView : FrameworkElement
Parameters
Type | Name | Description |
---|---|---|
System.String | menuName | The menu name for the tab. |
Returns
Type | Description |
---|---|
IViewProviderCollection | The view provider collection. |
Type Parameters
Name | Description |
---|---|
TIUniqueViewProvider | The type of the unique interface for the view provider. |
TViewProvider | The implementation of the provider. |
TView | The type of the view. |
AddPhoenixView<TIUniqueViewProvider, TViewProvider, TView>(ViewProviderInfo)
Adds a built-in phoenix view with transient lifetime to the view provider collection.
Declaration
public void AddPhoenixView<TIUniqueViewProvider, TViewProvider, TView>(ViewProviderInfo vpInfo)
where TIUniqueViewProvider : class, IViewProvider where TViewProvider : class, TIUniqueViewProvider where TView : FrameworkElement
Parameters
Type | Name | Description |
---|---|---|
ViewProviderInfo | vpInfo | The provider info for the view. |
Type Parameters
Name | Description |
---|---|
TIUniqueViewProvider | The type of the unique interface for the view provider. |
TViewProvider | The implementation of the provider. |
TView | The type of the view. |
AddView<TViewModel, TView>()
Adds a view with transient lifetime to the view provider collection.
Declaration
public IViewProviderCollection AddView<TViewModel, TView>()
where TViewModel : class where TView : FrameworkElement
Returns
Type | Description |
---|---|
IViewProviderCollection | The view provider collection. |
Type Parameters
Name | Description |
---|---|
TViewModel | The type of the viewmodel. |
TView | The type of the view. |
IsRequired(String)
Gets whether the contract name is for a required view provider.
Declaration
public bool IsRequired(string contractName)
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | The contract name for the view provider to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if the contract name is for a required view provider; otherwise, false. |
TryGetProvider(String, out ViewProviderInfo)
Gets the ViewProviderInfo associated with the specified contract name.
Declaration
public bool TryGetProvider(string contractName, out ViewProviderInfo info)
Parameters
Type | Name | Description |
---|---|---|
System.String | contractName | The contract name of the ViewProviderInfo to get. |
ViewProviderInfo | info | When this method returns, contains the ViewProviderInfo associated with the specified key, if the key is found; otherwise, null. |
Returns
Type | Description |
---|---|
System.Boolean | true if the ViewProviderCollection contains a ViewProviderInfo with the specified contract name; otherwise, false. |