IPlatformApplication.Application Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the .NET MAUI application instance.
public:
property Microsoft::Maui::IApplication ^ Application { Microsoft::Maui::IApplication ^ get(); };
public Microsoft.Maui.IApplication Application { get; }
member this.Application : Microsoft.Maui.IApplication
Public ReadOnly Property Application As IApplication
Property Value
An IApplication instance representing the current MAUI application.
Examples
// Accessing the main page from the application
var mainPage = platformApp.Application.MainPage;
// Triggering application lifecycle events
if (platformApp.Application is Application app)
{
app.OnStart();
}
Remarks
This property provides access to the main MAUI application instance, which contains application-level configuration, the main page, and application lifecycle methods. Use this to access application-wide properties and methods.