MainWindowViewModel.cs 1.3 KB

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