title: Xamarin Forms overriding OnAppearing causes app to crash
body: <p>I am trying to do a simple override and load some data when my page loads, I am using the following code in the code behind page.</p>
  
  <pre><code>namespace XYZ
  {
      public partial class MainPage : ContentPage
      {
          private Label results;
          private Label groupResults;
  
          public MainPage()
          {
              InitializeComponent();
  
              results = new Label();
  
              groupResults = new Label();
          }
  
          protected override void OnAppearing()
          {
              base.OnAppearing();
              storeIdTxt.Text = Settings.StoreIdSetting;
          }
  }
  }
  </code></pre>
  
  <p>If I uncomment the override things works just fine, the error I am getting seems to be a generic one attached here</p>
  
  <p><a href="https://i.stack.imgur.com/tcNZ8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tcNZ8.png" alt="Error Message"></a></p>
  
  <p>my settings class is fairly simple as follows</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using Plugin.Settings;
  using Plugin.Settings.Abstractions;
  
  namespace NWMPosNG.Helpers
  {
    /// &lt;summary&gt;
    /// This is the Settings static class that can be used in your Core solution or in any
    /// of your client applications. All settings are laid out the same exact way with getters
    /// and setters. 
    /// &lt;/summary&gt;
    public static class Settings
  {
      private static ISettings AppSettings
      {
          get
          {
              return CrossSettings.Current;
          }
      }
  
      #region Setting Constants
  
      private const string SettingsKey = "settings_key";
      private static readonly string SettingsDefault = string.Empty;
  
      private const string StoreId = null;
      private static readonly string StoreIdDefault = "0";
  
      #endregion
  
  
      public static string GeneralSettings
          {
              get
                  {
                      return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
                  }
  
              set
                  {
                      AppSettings.AddOrUpdateValue(SettingsKey, value);
                  }
          }
  
      public static string StoreIdSetting
          {
              get
              {
                  return AppSettings.GetValueOrDefault(StoreId, StoreIdDefault);
              }
  
              set
              {
                  AppSettings.AddOrUpdateValue(StoreId, value);
              }
          }
  }
  }
  </code></pre>
  
  <p>I narrowed down the issue to when I access the saved data using</p>
  
  <pre><code>storeIdTxt.Text = Settings.StoreIdSetting;
  </code></pre>
  
  <p>But I don't understand why that causes the crash.</p>