docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UIToolkitHost

    A class used to host an app in a UIDocument.

    This is a wrapper around a UIDocument that implements IUIToolkitHost.

    Inheritance
    object
    UIToolkitHost
    Implements
    IUIToolkitHost
    IHost
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    Implements

    IUIToolkitHost
    IHost
    IDisposable
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)