Beispiel #1
0
        private void executemethod(object parameter)
        {
            var    values = (object[])parameter;
            string name   = (string)values[0];
            bool   check  = (bool)values[1];

            if (check)
            {
                LessonList.Add(name);
            }
            else
            {
                LessonList.Remove(name);
            }

            var rawList = new List <int>();

            foreach (string l in LessonList)
            {
                int lesson = int.Parse(l);
                rawList.Add(lesson);
            }

            rawList.Sort();

            Lessons = "";
            foreach (int item in rawList)
            {
                string l = item.ToString();
                Lessons += l;
                Lessons += "., ";
            }
        }
        private async void PopulateLessonList()
        {
            List <Lesson> lessons = await App.DB.ShowLessons(studentValue);

            LessonList.Clear();
            foreach (Lesson lesson in lessons)
            {
                LessonList.Add(lesson);
            }
        }
        async Task ExecuteLoadLessonsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                LessonList.Clear();
                var lessons = await App.DB.ShowLessons(Student);

                foreach (var lesson in lessons)
                {
                    LessonList.Add(lesson);
                }
            }
            catch (Exception exception) { }
            finally { IsBusy = false; }
        }