瀏覽代碼

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

Smerdova Liza 7 月之前
父節點
當前提交
282709f219
共有 1 個文件被更改,包括 7 次插入1 次删除
  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