MainWindowViewModel.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Avalonia.Controls;
  2. using Practikaoy.Models;
  3. using Practikaoy.Views;
  4. using ReactiveUI;
  5. using System.Net;
  6. namespace Practikaoy.ViewModels
  7. {
  8. public class MainWindowViewModel : ViewModelBase
  9. {
  10. Sazonova2Context ConnectBD = new Sazonova2Context();
  11. AuthPageViewModel _authPage = new AuthPageViewModel();
  12. MeRoomViewModel _meRoom = new MeRoomViewModel(1);
  13. UserControl canic = new AuthPas();
  14. public UserControl Canic
  15. {
  16. get => canic;
  17. set => this.RaiseAndSetIfChanged(ref canic, value);
  18. }
  19. // UserControl _uthP = new MeRoomViewModel();
  20. public MeRoomViewModel MeRoom { get => _meRoom; set => _meRoom = value; }
  21. public AuthPageViewModel AuthPage { get => _authPage; set => _authPage = value; }
  22. public UserControl USE { get => canic; set => this.RaiseAndSetIfChanged(ref canic, value); }
  23. public void NextPage()
  24. {
  25. int ex = 0;
  26. if (AuthPage.PiklsPerson(ref ex))
  27. {
  28. _meRoom = new MeRoomViewModel(ex);
  29. USE = new MeRoom();
  30. }
  31. else { USE = new AuthPas(); }
  32. }
  33. public void PreviousPage()
  34. {
  35. MeRoom.IsEnableEdit = true;
  36. }
  37. }
  38. }