docs.unity3d.com
    Show / Hide Table of Contents

    Class App

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

    Inheritance
    Object
    App
    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 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>
    Implements
    IUIToolkitApp.hosts

    mainPage

    The main page of the application.

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

    Methods

    Dispose()

    Disposes the current App instance.

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()

    Dispose(Boolean)

    Disposes the current App instance.

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

    True to dispose managed resources.

    Finalize()

    Destructor.

    Declaration
    protected void Finalize()

    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.

    Implements
    IApp.Initialize(IServiceProvider, IHost)
    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()
    Implements
    IApp.Shutdown()

    Events

    shuttingDown

    Event called when the application is shutting down.

    Declaration
    public static event Action shuttingDown
    Event Type
    Type Description
    Action
    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