protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter.GetType() == typeof(Exercise))
            {
                selectedExercise = (Exercise)e.Parameter;
                int lastSetNo = _logEntryDao.GetLastSetNo(selectedExercise, pckDate.Date.Date);
                int newSetNo = ++lastSetNo;
                txtSet.Text = newSetNo.ToString();
            }
            else if (e.Parameter.GetType() == typeof(PayLoad))
            {
                PayLoad myPayload = new PayLoad();
                myPayload = (PayLoad)e.Parameter;

                selectedLogEntry = myPayload.Entry;
                selectedExercise = _exerciseDao.GetExerciseById(selectedLogEntry.ExerciseID);

                pckDate.Date = selectedLogEntry.LogDate;
                txtSet.Text = selectedLogEntry.SetNo;
                txtReps.Text =  selectedLogEntry.Reps;
                txtWeight.Text = selectedLogEntry.Weight;
                txtComments.Text = selectedLogEntry.Comments;

                if (myPayload.Status == "View")
                {
                    SetViewReadOnly();
                } else
                {
                    SetViewEdit();
                }
            }

            lblTitle.Text = selectedExercise.Name;
        }
 private void Grid_Tapped(object sender, TappedRoutedEventArgs e)
 {
     LogEntry selectedLogEntry = (e.OriginalSource as FrameworkElement).DataContext as LogEntry;
     PayLoad myPayLoad = new PayLoad();
     myPayLoad.Status = "View";
     myPayLoad.Entry = selectedLogEntry;
     Frame.Navigate(typeof(SetDetail), myPayLoad);
 }
 private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     LogEntry selectedLogEntry = (e.OriginalSource as FrameworkElement).DataContext as LogEntry;
     PayLoad myPayLoad = new PayLoad();
     myPayLoad.Status = "Edit";
     myPayLoad.Entry = selectedLogEntry;
     Frame.Navigate(typeof(SetDetail), myPayLoad);
 }