MainWindowViewModel.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. UserControl canic = new AuthPas();
  13. public UserControl Canic
  14. {
  15. get => canic;
  16. set => this.RaiseAndSetIfChanged(ref canic, value);
  17. }
  18. MeRoomViewModel _meRoom = new MeRoomViewModel(1);
  19. UserControl _root = new MeRoom();
  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 NaxtPage()
  24. {
  25. USE = new MeRoom();
  26. }
  27. public void PsssNext()
  28. {
  29. int id = 0;
  30. if (AuthPage.PiklsPerson(ref id))
  31. {
  32. _meRoom = new MeRoomViewModel(id);
  33. USE = new MeRoom();
  34. }
  35. else
  36. USE = new MeRoom();
  37. }
  38. public void EndintRoom()
  39. {
  40. MeRoom.UserisChanged = true;
  41. }
  42. }
  43. }