PageShowServiceViewModel.cs 674 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using Learn.Models;
  4. using Microsoft.EntityFrameworkCore;
  5. using ReactiveUI;
  6. using System.Linq;
  7. namespace Learn.ViewModels
  8. {
  9. internal class PageShowServiceViewModel : ViewModelBase
  10. {
  11. private List<Service> _serviceList;
  12. public List<Service> ServiceList { get => _serviceList; set => this.RaiseAndSetIfChanged(ref _serviceList, value); }
  13. public PageShowServiceViewModel()
  14. {
  15. FillList();
  16. }
  17. public void FillList()
  18. {
  19. ServiceList = MainWindowViewModel.myConnection.Services.Include(photo => photo.ServicePhotos).ToList();
  20. }
  21. }
  22. }