Table of Contents

Class Application

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

Provides methods and properties to manage an application.

public class Application : App, IBaseObject, IDisposableObject, IDisposable
Inheritance
Application
Implements

Examples

The following code shows how the Main method starts the Application event loop, with the given Window:

class Program
{
    [STAThread]
    public static void Main(string[] args)
    {
        var application = new Alternet.UI.Application();
        var window = new MainWindow();

        application.Run(window);

        window.Dispose();
        application.Dispose();
    }
}

Remarks

Use <xref:Alternet.UI.App.Run> method to start running the UI event loop until the application is terminated. The Current property gets the object representing the currently running application.

Constructors

Application(IApplicationHandler?)

Initializes a new instance of the Application class.

Fields

IsNetCoreApp

Gets whether 'NETCOREAPP' is defined.

Methods

CreateAndRun(Func<Window>, Action?)

Creates application and main form, runs and disposes them.