The instruction this.Frame.Navigate(typeof(RegionPage));
on my mainpage doesn't work. It generates an exception:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
So I tried putting it in some function after the mainpage and all goes fine.
My objective: I want to make a control such that, if is it the first time that the user opens the app, it will display a new page with tutorial.
Question: how can I work around that problem?
public MainPage()
{
this.InitializeComponent();
Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
TextBoxRicerca.Visibility = Visibility.Collapsed;
Mappe.Loaded += Mappe_Loaded;
Regione.RegNome = "";
this.Frame.Navigate(typeof(RegionPage));
}