PersonsViewModel.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using Avalonia.Media.TextFormatting;
  5. using reactivepril.Models;
  6. using ReactiveUI;
  7. namespace reactivepril.ViewModels
  8. {
  9. public class PersonsViewModel : ReactiveObject
  10. {
  11. public Galochkin41pContext db = new Galochkin41pContext();
  12. List<User> users;
  13. List<User> users0;
  14. string textFind;
  15. List<Gender> genders;
  16. Gender filteredGender;
  17. public List<User> Users { get => users; set => users = value; }
  18. public List<User> Users0 { get => users0; set => users0 = value; }
  19. public string TextFind { get => textFind; set => textFind = value; }
  20. public List<Gender> Genders { get => genders; set => genders = value; }
  21. public Gender FilteredGender { get => filteredGender; set => filteredGender = value; }
  22. public PersonsViewModel()
  23. {
  24. Users = db.Users.ToList();
  25. Genders =
  26. [
  27. new Gender() { NameGender = "Ñáðîñèòü ôèëüòð", IdGender = 0 },
  28. .. db.Genders.ToList()
  29. ];
  30. Users0 = Users;
  31. }
  32. }
  33. }