private void cancel_Click(object sender, RoutedEventArgs e) { Switcher.Switch("ProfilePage.xaml"); }
private void save_Click(object sender, RoutedEventArgs e) { user.Info.Age = int.Parse(ageVal.Text); if (Female.IsChecked == true) { user.Info.Sex = BiologicalSex.Female; } else { user.Info.Sex = BiologicalSex.Male; } user.Info.Weight.Number = Double.Parse(weightVal.Text); if (weightUnit.SelectedItem.ToString() == WeightUnit.Pounds) { user.Info.Weight.Unit = WeightUnit.Pounds; user.Goal.Weight.Unit = WeightUnit.Pounds; user.Goal.WeightChange.PerWeekWeight.Unit = WeightUnit.Pounds; } else { user.Info.Weight.Unit = WeightUnit.Kilograms; user.Goal.Weight.Unit = WeightUnit.Kilograms; user.Goal.WeightChange.PerWeekWeight.Unit = WeightUnit.Kilograms; } user.Info.Height.Number = Int32.Parse(heightVal.Text); if (heightUnit.SelectedItem.ToString() == HeightUnit.Centimeters) { user.Info.Height.Unit = HeightUnit.Centimeters; } else { user.Info.Height.Unit = HeightUnit.Feet; } if (activityLvlVal.SelectedItem.ToString() == ActivityLevel.None) { user.Info.ActivityLevel = ActivityLevel.None; } else if (activityLvlVal.SelectedItem.ToString() == ActivityLevel.Light) { user.Info.ActivityLevel = ActivityLevel.Light; } else if (activityLvlVal.SelectedItem.ToString() == ActivityLevel.Medium) { user.Info.ActivityLevel = ActivityLevel.Medium; } else { user.Info.ActivityLevel = ActivityLevel.Heavy; } user.Goal.Steps = Int32.Parse(stepGoalVal.Text); if (goalCombo.SelectedIndex == 0) { user.Goal.Weight.Number = user.Info.Weight.Number; user.Goal.WeightChange.PerWeekWeight.Number = 0.0; } else { user.Goal.Weight.Number = Double.Parse(weightGoalVal.Text); double num = Double.Parse(weightChange.SelectedItem.ToString()); if (goalCombo.SelectedIndex == 1) { user.Goal.WeightChange.PerWeekWeight.Number = -num; } else if (goalCombo.SelectedIndex == 2) { user.Goal.WeightChange.PerWeekWeight.Number = num; } user.Goal.CalorieGoal = user.CalcTDEE(); } Weight newW = new Weight(); newW.Number = user.Info.Weight.Number; newW.Unit = user.Info.Weight.Unit; newW.Date = DateTime.Today; user.WeightHistory[user.WeightHistory.Count - 1] = newW; //-----------------------------------// Switcher.Switch("ProfilePage.xaml"); }
private void AddButton_Click(object sender, RoutedEventArgs e) { Switcher.Switch("TrackerOptions.xaml"); }
private void Button_Click(object sender, RoutedEventArgs e) { Switcher.Switch("AddMealPage.xaml"); }
private void ReportButton_Click(object sender, RoutedEventArgs e) { Switcher.Switch("ActivityReportPage.xaml"); }
private void updateProfileClick(object sender, RoutedEventArgs e) { Switcher.Switch("UpdateInfoPage.xaml"); }
private void FinishButton_Click(object sender, RoutedEventArgs e) { Switcher.Switch("AddActivityPage.xaml"); }
private void CancelButton_Click(object sender, RoutedEventArgs e) { Switcher.Switch("ActivitiesPage.xaml"); }
private void HomeButton_Click(object sender, RoutedEventArgs e) { Switcher.Switch("MainPage.xaml"); }