/// <summary> /// Add the route (state restoration) and refresh the model every time we switch to the view /// </summary> protected override void OnAppearing() { base.OnAppearing(); App.CurrentRoute = "//Records/Geometries"; ViewModel = new ObjectsPageVM(); BindingContext = ViewModel; }
/// <summary> /// Initialise the geometry list and listen for a record being added /// </summary> public ObjectsListPage() { InitializeComponent(); ViewModel = new ObjectsPageVM(); BindingContext = ViewModel; MessagingCenter.Subscribe <AddRecordButtonCommand>(this, "AddRecord", (sender) => { Device.BeginInvokeOnMainThread(() => { Navigation.PushAsync(new FormSelectionPage(null), true); }); }); }