As a beginner, I wanted to make a simple game with Xamarin.Forms using GTK#. Unfortunately, when I started to use a Navigation Page, there is a line throwing a "System.NullReferenceException" error. When I debug the app with a real Android device it runs fine, so I guess the problem lies the GTK# part.
Here's the code for the GTK# part :
public static void Main (string[] args)
{
Gtk.Application.Init();
Forms.Init();
var app = new App();
var window = new FormsWindow();
window.LoadApplication(app); //The line throwing the error
window.SetApplicationTitle("OpenCountrySim");
window.Show();
Gtk.Application.Run();
}
And here's the app constructor :
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MainPage());
}