Pārlūkot izejas kodu

показ списка при пустом листе

Smerdova Liza 7 mēneši atpakaļ
vecāks
revīzija
282709f219
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7 1
      PDK_Concert/Pages/RehearsalPage.xaml.cs

+ 7 - 1
PDK_Concert/Pages/RehearsalPage.xaml.cs

@@ -58,7 +58,13 @@ namespace PDK_Concert.Pages
                 };
                 Classes.DataBaseClass.connect.RehearsalSchedule.Add(rehearsalSchedule);
                 Classes.DataBaseClass.connect.SaveChanges();
-                listRehearsal.ItemsSource = Classes.DataBaseClass.connect.RehearsalSchedule.Where(x => x.IDSchedule == ID).ToList();
+                schedules = Classes.DataBaseClass.connect.RehearsalSchedule.Where(x => x.IDSchedule == ID).ToList();
+                listRehearsal.ItemsSource = schedules;
+                if (schedules.Count > 0)
+                {
+                    not.Visibility = Visibility.Collapsed;
+                    listRehearsal.Visibility = Visibility.Visible;
+                }
                 time.Text = "";
             }
             else