MainWindowViewModel.cs 860 B

123456789101112131415161718192021222324252627282930313233
  1. using Avalonia.Controls;
  2. using ReactiveUI;
  3. using Teachers.Models;
  4. namespace Teachers.ViewModels
  5. {
  6. public class MainWindowViewModel : ViewModelBase
  7. {
  8. #region Properties
  9. public static _43pTryaninaContext myConnection = new _43pTryaninaContext();
  10. public static MainWindowViewModel Instance; // создаем объект
  11. public MainWindowViewModel()
  12. {
  13. Instance = this; // инициализируем его в конструкторе
  14. }
  15. UserControl _us = new TeachersView();
  16. public UserControl Us
  17. {
  18. get => _us;
  19. set => this.RaiseAndSetIfChanged(ref _us, value);
  20. }
  21. #endregion
  22. //TeachersViewModel tvm = new();
  23. void a()
  24. {
  25. //tvm.TeachersList[0].GenderNavigation.Gender1
  26. }
  27. }
  28. }