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
    IDisposable
    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, IDisposable

    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<IUIToolkitHost> hosts { get; }
    Property Value
    Type Description
    IEnumerable<IUIToolkitHost>

    mainPage

    The main page of the application.

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

    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, IHost)

    Initializes the current App instance.

    Declaration
    public void Initialize(IServiceProvider serviceProvider, IHost host)
    Parameters
    Type Name Description
    IServiceProvider serviceProvider

    The service provider to use.

    IHost host

    The host to use.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when a current App instance already exists.

    ArgumentNullException

    Thrown when one or more required arguments are null.

    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
    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)