MainWindowViewModel.cs 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. public void ChangePageToHotels()
  30. {
  31. US = new Hotels();
  32. }
  33. public void ChangePageToTours()
  34. {
  35. US = new Tours();
  36. }
  37. }
  38. }