MainWindowViewModel.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Avalonia.Controls;
  2. using ReactiveUI;
  3. using System.Net;
  4. using TourAgent.Models;
  5. using TourAgent.Views;
  6. namespace TourAgent.ViewModels
  7. {
  8. public class MainWindowViewModel : ViewModelBase
  9. {
  10. public static UP_SmirnovContext DB = new UP_SmirnovContext();
  11. UserControl us = new Views.Menu();
  12. public UserControl US
  13. {
  14. get => us;
  15. set => this.RaiseAndSetIfChanged(ref us, value);
  16. }
  17. MenuViewModel menuVM = new MenuViewModel();
  18. public MenuViewModel MenuVM
  19. {
  20. get => menuVM;
  21. set => menuVM = value;
  22. }
  23. ToursViewModel _toursVM = new ToursViewModel();
  24. public ToursViewModel ToursVM
  25. {
  26. get => _toursVM;
  27. set => _toursVM = value;
  28. }
  29. HotelsViewModel _hotelsVM = new HotelsViewModel();
  30. public HotelsViewModel HotelsVM
  31. {
  32. get => _hotelsVM;
  33. set => _hotelsVM = value;
  34. }
  35. public void ChangePageToHotels()
  36. {
  37. US = new Hotels();
  38. }
  39. public void ChangePageToTours()
  40. {
  41. US = new Tours();
  42. }
  43. public void ToMenu()
  44. {
  45. US = new Views.Menu();
  46. }
  47. }
  48. }