docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class App

    A base class to implement an App instance using UI Toolkit.

    Inheritance
    object
    App
    Implements
    IUIToolkitApp
    IApp<UIToolkitHost>
    IApp
    IDisposable
    IInitializableComponent
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.MVVM
    Assembly: Unity.AppUI.MVVM.dll
    Syntax
    public class App : IUIToolkitApp, IApp<UIToolkitHost>, IApp, IDisposable, IInitializableComponent

    Properties

    current

    The current App instance.

    Declaration
    public static App current { get; }
    Property Value
    Type Description
    App
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the current App instance is not available.

    hosts

    The hosts of the application.

    Declaration
    public IEnumerable<UIToolkitHost> hosts { get; }
    Property Value
    Type Description
    IEnumerable<UIToolkitHost>

    rootVisualElement

    The main page of the application.

    Declaration
    public VisualElement rootVisualElement { get; set; }
    Property Value
    Type Description
    VisualElement

    services

    The services of the application.

    Declaration
    public IServiceProvider services { get; }
    Property Value
    Type Description
    IServiceProvider

    Methods

    Dispose()

    Disposes the current App instance.

    Declaration
    public void Dispose()

    Dispose(bool)

    Disposes the current App instance.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    True to dispose managed resources.

    ~App()

    Destructor.

    Declaration
    protected ~App()

    Initialize(IServiceProvider, UIToolkitHost)

    Initializes the current App instance.

    Declaration
    public void Initialize(IServiceProvider serviceProvider, UIToolkitHost host = null)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The service provider to use.

    UIToolkitHost host

    The host to use.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when a current App instance already exists.

    ArgumentNullException

    Thrown when serviceProvider is null.

    InitializeComponent()

    Initializes the component.

    Declaration
    public virtual void InitializeComponent()

    Shutdown()

    Called to shutdown the application.

    Declaration
    public virtual void Shutdown()

    Events

    shuttingDown

    Event called when the application is shutting down.

    Declaration
    public static event Action shuttingDown
    Event Type
    Type Description
    Action

    Implements

    IUIToolkitApp
    IApp<THost>
    IApp
    IDisposable
    IInitializableComponent
    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)