public AddEntryPageViewModel(INavigationService navigationService, IEventAggregator ea) : base(navigationService) { _ea = ea; SettingVals = new SettingVals(); PickerSelectedIndex = 1; SettingValsValidated = new SettingValsValidated(); AddWeightToListCommand = new DelegateCommand(AddWeightToList); DeleteEntryCommand = new DelegateCommand(HandleDeleteEntry); AddOneToWeightCommand = new DelegateCommand(HandleAddOneToWeight); SubtractOneToWeightCommand = new DelegateCommand(HandleSubtractOneToWeight); DeleteAction = false; DeleteActionEnabled = false; EntryDate = DateTime.Now; NewDate = DateTimeOffset.Now; MaxEntryDate = DateTimeOffset.Now; PickerSource = new ObservableCollection <string> { AppResources.LowActivityPickItem, AppResources.LightActivityPickItem, AppResources.MediumActivityPickItem, AppResources.HeavyActivityPickItem }; }
public InitialSetupPageViewModel(INavigationService navigationService, IEventAggregator ea) : base(navigationService) { Title = AppResources.InitialSetupPageTitle; _ea = ea; SettingVals = new SettingVals(); SettingValsValidated = new SettingValsValidated(); SaveInfoCommand = new DelegateCommand(SaveInfoAsync); SelectImperialCommand = new DelegateCommand(SelectImperial); SelectMetricCommand = new DelegateCommand(SelectMetric); SelectMaleCommand = new DelegateCommand(SelectMale); SelectFemaleCommand = new DelegateCommand(SelectFemale); // Initialize app SettingVals Settings.GoalMetNotified = false; SettingVals.MinDate = DateTimeOffset.Now.AddDays(10); GoalDate = DateTime.UtcNow.AddDays(180); // DEBUG CHANGE! //BirthDate = DateTimeOffset.Parse("2/25/1988"); BirthDate = DateTime.UtcNow.AddYears(-21); BirthDateMinDate = DateTimeOffset.Now.AddYears(-150); BirthDateMaxDate = DateTimeOffset.Now.AddYears(-1); MaxGoalDate = DateTimeOffset.Now.AddYears(2); // Setting units to default imperial SettingVals.Units = true; SettingVals.WaistSizeEnabled = true; SettingVals.PickerSelectedItem = 1; ImperialSelectedBorderColor = (Color)Application.Current.Resources["ButtonSelected"]; MaleSelectedBorderColor = (Color)Application.Current.Resources["ButtonSelected"]; PickerSource = new ObservableCollection <string> { AppResources.LowActivityPickItem, AppResources.LightActivityPickItem, AppResources.MediumActivityPickItem, AppResources.HeavyActivityPickItem }; MaleText = "\uf183 " + AppResources.MaleGenderSwitchLabel; FemaleText = "\uf182 " + AppResources.FemaleGenderSwitchLabel; }
public SettingsPageViewModel(INavigationService navigationService, IEventAggregator ea) : base(navigationService) { Title = AppResources.SettingsPageTitle; _ea = ea; SettingVals = new SettingVals(); PickerSelectedIndex = 1; SettingValsValidated = new SettingValsValidated(); SaveInfoCommand = new DelegateCommand(SaveInfoAsync); DeleteAllCommand = new DelegateCommand(DeleteAll); SelectImperialCommand = new DelegateCommand(SelectImperial); SelectMetricCommand = new DelegateCommand(SelectMetric); SelectMaleCommand = new DelegateCommand(SelectMale); SelectFemaleCommand = new DelegateCommand(SelectFemale); _ea.GetEvent <SendSetupInfoToSettingsEvent>().Subscribe(HandleNewSetupInfo); DeleteAllButton = AppResources.settings_page_delete_all_button; BirthDateMinDate = DateTimeOffset.Now.AddYears(-150); BirthDateMaxDate = DateTimeOffset.Now.AddYears(-1); ImperialSelectedBorderColor = (Color)Application.Current.Resources["ButtonSelected"]; MaleSelectedBorderColor = (Color)Application.Current.Resources["ButtonSelected"]; SettingVals.MinDate = DateTimeOffset.Now.AddDays(10); MaxGoalDate = DateTimeOffset.Now.AddYears(2); PickerSource = new ObservableCollection <string> { AppResources.LowActivityPickItem, AppResources.LightActivityPickItem, AppResources.MediumActivityPickItem, AppResources.HeavyActivityPickItem }; MaleText = "\uf183 " + AppResources.MaleGenderSwitchLabel; FemaleText = "\uf182 " + AppResources.FemaleGenderSwitchLabel; _timelft = 5; }