Class UIToolkitHost
A class used to host an app in a UIDocument.
This is a wrapper around a UIDocument that implements IUIToolkitHost.
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: Unity.AppUI.MVVM.dll
Syntax
public sealed class UIToolkitHost : IUIToolkitHost, IHost, IDisposable
Constructors
UIToolkitHost(UIDocument)
Default constructor. Creates a new instance of UIToolkitHost that hosts an app in the given UIDocument.
Declaration
public UIToolkitHost(UIDocument uiDocument)
Parameters
Type | Name | Description |
---|---|---|
UIDocument | uiDocument | The UIDocument to host the app in. |
Methods
Dispose()
Disposes of the host.
Declaration
public void Dispose()
HostApplication(IUIToolkitApp, IServiceProvider)
Called when the app is being hosted.
A service provider is provided that can be used to resolve services through the host itself.
Declaration
public void HostApplication(IUIToolkitApp app, IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
IUIToolkitApp | app | The app to host. |
IServiceProvider | serviceProvider | The service provider to use. |
TryFindElement<T>(out T)
Tries to find an element of the given type in the visual tree of the app.
Declaration
public bool TryFindElement<T>(out T element) where T : VisualElement
Parameters
Type | Name | Description |
---|---|---|
T | element | The element that was found. |
Returns
Type | Description |
---|---|
bool | True if the element was found, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | The type of the element to find. |