Exemple #1
0
        void SetupGroupTab()
        {
            _btnGroupTab.AddButton(BtnWeek);
            _btnGroupTab.AddButton(BtnDay);

            _btnGroupTab.UpdateCurrentButton(BtnWeek);
            _btnGroupTab.Toggled += GroupTab_Toggled;

            _btnGroupTab.CurrentIndex = 0;
        }
        /// <summary>
        /// Selects a current tab and shows it
        /// </summary>
        /// <param name="type"></param>
        public void SetCurrentTab(TabType type)
        {
            switch (type)
            {
            case TabType.Dashboard:
                _btnGroup.UpdateCurrentButton(BtnDash);
                break;

            case TabType.History:
                _btnGroup.UpdateCurrentButton(BtnHistory);
                break;

            case TabType.Modes:
                _btnGroup.UpdateCurrentButton(BtnModes);
                break;

            case TabType.Alarms:
                _btnGroup.UpdateCurrentButton(BtnAlarms);
                break;
            }
        }
Exemple #3
0
        /// <summary>
        /// Selects a current tab and shows it
        /// </summary>
        /// <param name="type"></param>
        public void SetCurrentTab(TabType type)
        {
            switch (type)
            {
            case TabType.Dashboard:
                _btnGroup.UpdateCurrentButton(BtnDash);
                break;

            case TabType.Inventory:
                _btnGroup.UpdateCurrentButton(BtnInventory);
                break;

            case TabType.Settings:
                _btnGroup.UpdateCurrentButton(BtnSettings);
                break;

            case TabType.FAQ:
                _btnGroup.UpdateCurrentButton(BtnFAQ);
                break;
            }
        }
Exemple #4
0
        public override void AboutToShow()
        {
            base.AboutToShow();

            Titlebar.IsVisible = true;

            ViewModel.Reset();

            NurseDate.CalendarDate = DateTime.Now;
            NurseDate.Date         = null;
            NurseStartTime.Time    = null;
            NurseTotalTime.Time    = TimeSpan.FromMinutes(0);

            _btnGroup.UpdateCurrentButton(null);
            BtnAddNote.IsPressed = false;

            ResolveNurseStartTimeFormat();
        }
        private void ConfigureBottleAndInventory()
        {
            _btnGroupMilk.AddButton(_btnMilkFormula);
            _btnGroupMilk.AddButton(_btnBreastMilk);
            _btnGroupMilk.Toggled += (sender, item, index) =>
            {
                _gridMilkOptions.IsVisible = item == _btnBreastMilk;
                if (_gridMilkOptions.IsVisible == false)
                {
                    _btnGroupBreastMilk.UpdateCurrentButton(null);
                }
                this.InvalidateMeasure();
            };

            _btnGroupBreastMilk.AddButton(_btnMilkFridge);
            _btnGroupBreastMilk.AddButton(_btnMilkFreezer);
            _btnGroupBreastMilk.AddButton(_btnMilkOther);

            _btnGroupBreastMilk.Toggled += (sender, item, index) =>
            {
                if (!_updatingMilkStorageFromCode)
                {
                    if (item == _btnMilkFridge)
                    {
                        InventoryView.Initialize(InventoryFilter.Fridge);
                        ViewModel.ShowInventoryCommand?.Execute(true);
                        LeftPageType = null;
                    }
                    else if (item == _btnMilkFreezer)
                    {
                        InventoryView.Initialize(InventoryFilter.Freezer);
                        ViewModel.ShowInventoryCommand?.Execute(true);
                        LeftPageType = null;
                    }
                    else if (item == _btnMilkOther)
                    {
                        InventoryView.Initialize(InventoryFilter.Other);
                        ViewModel.ShowInventoryCommand?.Execute(true);
                        LeftPageType = null;
                    }
                    else
                    {
                        ViewModel.ShowInventoryCommand?.Execute(false);
                    }
                }
            };
        }
        public override void AboutToShow()
        {
            base.AboutToShow();

            // Restore style:
            Titlebar.IsVisible = true;
            RootLayout.Style   = (Style)Application.Current.Resources["AbsoluteLayout_NavigationOnTop"];
            //TODO: Update this approach
            BtnAddNote.IsPressed = false;

            var model = (NurseSessionModel)BindingContext;

            if (model != null)
            {
                model.Reset();
            }

            _btnGroup.UpdateCurrentButton(null);

            if (SessionManager.Instance.CurrentSession != null)
            {
                SessionManager.Instance.CurrentSession.PropertyChanged += CurrentSession_PropertyChanged;
            }
        }
        private void UpdateStorageType(bool fromModelToGui = true)
        {
            _updatingMilkStorageFromCode = true;

            var currentSession = HistorySession;

            if (currentSession != null)
            {
                if (fromModelToGui)
                {
                    if (currentSession.Milk == MilkType.Formula)
                    {
                        _btnGroupMilk.UpdateCurrentButton(_btnMilkFormula);
                        _btnGroupBreastMilk.UpdateCurrentButton(null);
                    }
                    else if (currentSession.Milk == MilkType.BreastMilk)
                    {
                        _btnGroupMilk.UpdateCurrentButton(_btnBreastMilk);
                        switch (currentSession.Storage)
                        {
                        case StorageType.Fridge:
                            _btnGroupBreastMilk.UpdateCurrentButton(_btnMilkFridge);
                            break;

                        case StorageType.Freezer:
                            _btnGroupBreastMilk.UpdateCurrentButton(_btnMilkFreezer);
                            break;

                        case StorageType.Other:
                            _btnGroupBreastMilk.UpdateCurrentButton(_btnMilkOther);
                            break;

                        default:
                            _btnGroupBreastMilk.UpdateCurrentButton(null);
                            break;
                        }
                    }
                }
                else
                {
                    if (_btnGroupMilk.CurrentButton == _btnMilkFormula)
                    {
                        currentSession.Milk    = MilkType.Formula;
                        currentSession.Storage = StorageType.Other;
                    }
                    else if (_btnGroupMilk.CurrentButton == _btnBreastMilk)
                    {
                        currentSession.Milk = MilkType.BreastMilk;

                        if (_btnGroupBreastMilk.CurrentButton == _btnMilkFridge)
                        {
                            currentSession.Storage = StorageType.Fridge;
                        }
                        else if (_btnGroupBreastMilk.CurrentButton == _btnMilkFreezer)
                        {
                            currentSession.Storage = StorageType.Freezer;
                        }
                        else
                        {
                            currentSession.Storage = StorageType.Other;
                        }
                    }
                }
            }

            _updatingMilkStorageFromCode = false;
        }