docs.unity3d.com
    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
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.AppUI.MVVM
    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()
    Implements
    IDisposable.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.

    Implements
    IUIToolkitHost.HostApplication(IUIToolkitApp, IServiceProvider)

    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
    Boolean

    True if the element was found, false otherwise.

    Type Parameters
    Name Description
    T

    The type of the element to find.

    Implements
    IUIToolkitHost.TryFindElement<T>(out T)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023