GlobalsData.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Avalonia.Controls;
  2. using AvaloniaApplication4.ViewModels;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace AvaloniaApplication4.AdditionalModels
  10. {
  11. public class GlobalsData : ViewModelBase
  12. {
  13. /// <summary>
  14. /// смена вложенных страниц
  15. /// </summary>
  16. UserControl activePage;
  17. UserControl mainUserControl;
  18. public GlobalsData()
  19. {
  20. this.activePage = new UserControl();
  21. this.mainUserControl = new UserControl();
  22. }
  23. public UserControl GlobalUserControl
  24. {
  25. get { return activePage; }
  26. set
  27. {
  28. if (activePage == value)
  29. return;
  30. activePage = value;
  31. OnPropertyChanged(nameof(GlobalUserControl));
  32. }
  33. }
  34. public UserControl GlobalMainUserControl
  35. {
  36. get { return mainUserControl; }
  37. set
  38. {
  39. if (mainUserControl == value)
  40. return;
  41. mainUserControl = value;
  42. OnPropertyChanged(nameof(GlobalMainUserControl));
  43. }
  44. }
  45. }
  46. }