public static DeliveryPageModel GetSingleton() { if (_singleton == null) { _singleton = new DeliveryPageModel(); } return(_singleton); }
public DeliveryPage(string zipCode) { try { InitializeComponent(); this.BindingContext = DeliveryPageModel.GetSingleton(); this.Appearing += DeliveryPage_Appearing; (this.BindingContext as DeliveryPageModel).Initialize(this.Navigation, zipCode); } catch (Exception e) { Crashlytics.Log(e); } }
private void DeliveryPage_Appearing(object sender, EventArgs e) { try { var model = DeliveryPageModel.GetSingleton(); if (Debugger.IsAttached) { model.DeliveryName = "Scott Spivey"; model.DeliveryPhone = "555-555-1212"; model.DeliveryAddress = "1668 Main St, Sarasota, FL, United States"; } } catch (Exception ex) { Crashlytics.Log(ex); } }
private DeliveryPageModel() { _singleton = this; }