Exemplo n.º 1
0
        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
            };
        }
Exemplo n.º 2
0
        public MainPageViewModel(INavigationService navigationService, IEventAggregator ea)
            : base(navigationService)
        {
            Title = AppResources.MainPageTitle;
            _ea   = ea;

            SettingVals = new SettingVals();

            AddWeightToListCommand = new DelegateCommand(AddWeightToList);

            ButtonEnabled     = true;
            NewWaistSizeEntry = Settings.WaistSize;
            WeightLeftChart   = new RadialGaugeChart
            {
                BackgroundColor = SKColors.Transparent,
                MinValue        = 0,
                MaxValue        = 100,
                Margin          = 0,
            };
            DaysLeftChart = new RadialGaugeChart
            {
                BackgroundColor = SKColors.Transparent,
                MinValue        = 0,
                MaxValue        = 100,
                Margin          = 0,
            };

            //_ea.GetEvent<NewGoalEvent>().Subscribe(HandleNewGoal);
            _ea.GetEvent <UpdateSetupInfoEvent>().Subscribe(HandleUpdateSetupInfo);
            ea.GetEvent <AddWeightEvent>().Subscribe(HandleNewWeightEntry);
        }
        public SplashScreenPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService)
            : base(navigationService)
        {
            _navigationService = navigationService;

            SettingVals       = new SettingVals();
            LatestWeightEntry = new WeightEntry();
            AllWeightEntries  = new List <WeightEntry>();
        }
        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;
        }
Exemplo n.º 5
0
        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;
        }