dev-notes/.NET/Xamarin/App.xaml.cs.md
2021-01-31 11:05:37 +01:00

35 lines
699 B
Markdown

# App.xaml.cs
This `App` class is defined as `public` and derives from the Xamarin.Forms `Application` class.
The constructor has just one responsibility: to set the `MainPage` property of the `Application` class to an object of type `Page`.
```cs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace AppName
{
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
protected override void OnStart()
{
}
protected override void OnSleep()
{
}
protected override void OnResume()
{
}
}
}
```