Beispiel #1
0
        public AllAnnouncementViewModel()
        {
            var announcements = getAnnouncements().ToList();

            Announcements.Clear();
            foreach (Announcement a in announcements)
            {
                a.BitmapImage = LoadPhoto(a.seller.Value);
                Announcements.Add(a);
            }


            tmpCategories = announcementRepository.getCategories().Distinct().ToList();
            tmpSellers    = userRepository.getAllNames().Distinct().ToList();
            tmpRegions    = regionRepository.getRegions();
            SelectedIndex = 0;
            Info          = $"Найдено {Announcements.Count}";
            MAX_COST      = announcementRepository.MaxCost();
            MaxCost       = MAX_COST.ToString();

            viewWindow            = new ViewWindow(this);
            viewWindow.Visibility = System.Windows.Visibility.Hidden;
        }
Beispiel #2
0
 public AddWindowViewModel()
 {
     tmpCategories = announcementRepository.getCategories().Distinct().ToList();
     tmpRegions    = regionRepository.getRegions();
 }