예제 #1
0
        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;
        }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }