MainWindowViewModel.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using Avalonia.Controls;
  2. using Avalonia.Media;
  3. using LoginGenerator.Models;
  4. using ReactiveUI;
  5. using System;
  6. using System.IO;
  7. namespace LoginGenerator.ViewModels
  8. {
  9. public class MainWindowViewModel : ViewModelBase
  10. {
  11. UserControl us = new GeneratePage();
  12. public UserControl US
  13. {
  14. get => us;
  15. set => this.RaiseAndSetIfChanged(ref us, value);
  16. }
  17. DataOutputViewModel dataOutput = new DataOutputViewModel();
  18. public DataOutputViewModel DataOutputVM
  19. {
  20. get => dataOutput;
  21. set => dataOutput = value;
  22. }
  23. GeneratePageViewModel generatePage = new GeneratePageViewModel();
  24. public GeneratePageViewModel GeneratePageVM
  25. {
  26. get => generatePage;
  27. set => generatePage = value;
  28. }
  29. public void ViewUsersData()
  30. {
  31. US = new DataOutput();
  32. DataOutputVM.FillingUsersList();
  33. if(GeneratePageVM.Theme == true)
  34. {
  35. DataOutputVM.Background = new SolidColorBrush(Color.FromRgb(80, 80, 80));
  36. DataOutputVM.Background2 = new SolidColorBrush(Color.FromRgb(128, 128, 128));
  37. }
  38. else
  39. {
  40. DataOutputVM.Background = new SolidColorBrush(Color.FromRgb(248, 244, 255));
  41. DataOutputVM.Background2 = new SolidColorBrush(Color.FromRgb(236, 233, 255));
  42. }
  43. }
  44. public void ViewGeneratePage()
  45. {
  46. US = new GeneratePage();
  47. }
  48. }
  49. }