PageSwitcher.cs 561 B

123456789101112131415161718192021222324252627
  1. using Avalonia.Controls;
  2. using HelloItQuantum.Views;
  3. using HelloItQuantum.ViewModels;
  4. namespace HelloItQuantum.Navigation
  5. {
  6. /// <summary>
  7. /// Используется для смены страницы/активности
  8. /// </summary>
  9. public class PageSwitcher : ViewModelBase
  10. {
  11. private UserControl? view = new HomeView();
  12. /// <summary>
  13. /// Текущая отображаемая страница
  14. /// </summary>
  15. public UserControl View
  16. {
  17. get => view;
  18. set
  19. {
  20. view = value;
  21. OnPropertyChanged(nameof(View));
  22. }
  23. }
  24. }
  25. }