async public void OnPickerSelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = FilierPicker.SelectedIndex; if (selectedIndex != -1) { var FilierName = FilierPicker.Items[selectedIndex]; var id = DcFilier[FilierName]; DcLesson = new Dictionary <string, int>(); var NameList = new List <string>(); var LessonVar = await dataLesson.GetLessonNameByFilier(id); foreach (Lesson Data in LessonVar) { DcLesson.Add(Data.LessonName, Data.IdLesson); NameList.Add(Data.LessonName); } LessonPicker.ItemsSource = NameList; } }