Updating the WalkEntryPage code-behind using C#
Now that we have updated our WalkEntryPageViewModel
to take advantage of the NavigationService
that will enable our ViewModel to navigate within the navigation stack, the next step is to begin updating the underlying C# code within our WalkEntryPage
code-behind file so that it will communicate with our ViewModel to allow for navigation.
Let's take a look at how we can achieve this by following these steps:
- Open the
WalkEntryPage.xaml.cs
code-behind file, ensuring that it is displayed within the code editor, and enter the following highlighted code sections:
//
// WalkEntryPage.xaml.cs
// Data Entry screen that allows new walk information to be added
//
// Created by Steven F. Daniel on 14/05/2018
// Copyright © 2018 GENIESOFT STUDIOS. All rights reserved.
//
using System;
using TrackMyWalks.Services;
using TrackMyWalks.ViewModels;
using Xamarin.Forms;
namespace TrackMyWalks.Views...