Class App
A base class to implement an App instance using UI Toolkit.
Inherited Members
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 |