/*
         * Event handler to handle when a user switches between current and historic medications
         * resetting the sorting and changing the listview items.
         */
        void Handle_MedicationChanged(object sender, SegmentedControl.FormsPlugin.Abstractions.ValueChangedEventArgs e)
        {
            switch (e.NewValue)
            {
            case 0:
                if (UserController.Instance.LoggedInUser.currentMedications.Count == 0)
                {
                    NoDataLabel.IsVisible     = true;
                    MedicationsList.IsVisible = false;
                }
                else
                {
                    NoDataLabel.IsVisible     = false;
                    MedicationsList.IsVisible = true;
                }
                observableMedicationList.Clear();
                observableMedicationList.AddRange(UserController.Instance.LoggedInUser.currentMedications);
                break;

            case 1:
                if (UserController.Instance.LoggedInUser.historicMedications.Count == 0)
                {
                    NoDataLabel.IsVisible     = true;
                    MedicationsList.IsVisible = false;
                }
                else
                {
                    NoDataLabel.IsVisible     = false;
                    MedicationsList.IsVisible = true;
                }

                observableMedicationList.Clear();
                observableMedicationList.AddRange(UserController.Instance.LoggedInUser.historicMedications);
                break;
            }
        }
 /// <summary>
 /// Activated whenever focus is on this page
 /// </summary>
 protected override async void OnAppearing()
 {
     UserList.Clear();
     currentIndex = 0;
     await LoadItems();
 }
Exemplo n.º 3
0
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public void LoadProvider()
        {
            PROVIDER.Clear();
            PROVIDER.AddRange(XMPPProviders.INSTANCE.providersB);
        }
Exemplo n.º 4
0
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--


        #endregion

        #region --Misc Methods (Private)--
        private void LoadClients()
        {
            CLIENTS.Clear();
            CLIENTS.AddRange(ConnectionHandler.INSTANCE.getClients().Select((x) => new XMPPClientDataTemplate(x)));
        }