コード例 #1
0
        public void LoadNotification()
        {
            ImusCityHallEntities db = new ImusCityHallEntities();
            var notif = db.GetCheckExpiryNotice().ToList();

            if (notif.Count != 0)
            {
                bdgNotif.Badge      = notif.Count;
                btnNotif.Visibility = Visibility.Visible;
                lvNotif.ItemsSource = notif;
                CollectionView           view             = (CollectionView)CollectionViewSource.GetDefaultView(lvNotif.ItemsSource);
                PropertyGroupDescription groupDescription = new PropertyGroupDescription("GroupName");
                view.GroupDescriptions.Add(groupDescription);
            }
            else
            {
                bdgNotif.Badge      = 0;
                btnNotif.Visibility = Visibility.Visible;
                lvNotif.ItemsSource = null;
            }
        }