Application2
In order to properly use RedCorners.Forms, you are encouraged to derive your main Application class from RedCorners.Forms.Application2
instead of the built-in Application
that comes with Xamarin.Forms.
Preparing the Application
RedCorners.Forms provides its own Application base class, called Application2
, which is located under the RedCorners.Forms
namespace. Modify your App to inherit from the new Application2
class instead of Xamarin.Forms Application:
//App.xaml.cs
using System;
using Xamarin.Forms;
using RedCorners.Forms;
namespace RedCorners.Demo
{
public partial class App : Application2
{
public override void InitializeSystems()
{
// Because we also have an App.xaml file
InitializeComponent();
base.InitializeSystems();
}
// Tell RedCorners.Forms what our first page should be
public override Page GetFirstPage() =>
new Views.MainPage();
}
}
If you use an App.xaml file too, you have to change the base class there as well:
<rf:Application2 xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:rf="clr-namespace:RedCorners.Forms;assembly=RedCorners.Forms"
x:Class="RedCorners.Demo.App">
</rf:Application2>
Now if you run your application, RedCorners.Forms should boot up and launch your Views.MainPage
Page.