FriendElement.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using Avalonia.Controls;
  2. using Avalonia.Controls.Shapes;
  3. using HelloItQuantum.ViewModels;
  4. using System.Collections.ObjectModel;
  5. namespace HelloItQuantum.Models
  6. {
  7. public class FriendElement : MainWindowViewModel
  8. {
  9. int selectedElementIndex = 0;
  10. int selectedColorIndex = 0;
  11. int selectedNavigateOne = 0;
  12. int selectedNavigateTwo = 0;
  13. bool isVisibleNavigateOne = false;
  14. bool isVisibleNavigateTwo = false;
  15. public int Id { get; set; }
  16. public ObservableCollection<ComboBoxItem> CbElement { get; set; }
  17. public ObservableCollection<Ellipse> CbColor { get; set; }
  18. public ObservableCollection<ComboBoxItem> CbNavigateOne { get; set; }
  19. public ObservableCollection<ComboBoxItem> CbNavigateTwo { get; set; }
  20. public int SelectedElementIndex
  21. {
  22. get => selectedElementIndex;
  23. set
  24. {
  25. selectedElementIndex = value;
  26. GameCreateFriendVM.UpdateVisible(Id);
  27. GameCreateFriendVM.UpdateDrawing(Id);
  28. }
  29. }
  30. public int SelectedColorIndex
  31. {
  32. get => selectedColorIndex;
  33. set
  34. {
  35. selectedColorIndex = value;
  36. GameCreateFriendVM.UpdateDrawing(Id);
  37. }
  38. }
  39. public int SelectedNavigateOne
  40. {
  41. get => selectedNavigateOne;
  42. set
  43. {
  44. selectedNavigateOne = value;
  45. GameCreateFriendVM.UpdateNavigate(Id);
  46. }
  47. }
  48. public int SelectedNavigateTwo
  49. {
  50. get => selectedNavigateTwo;
  51. set
  52. {
  53. selectedNavigateTwo = value;
  54. GameCreateFriendVM.UpdateNavigate(Id);
  55. }
  56. }
  57. public bool IsVisibleNavigateOne
  58. {
  59. get => isVisibleNavigateOne;
  60. set => SetProperty(ref isVisibleNavigateOne, value);
  61. }
  62. public bool IsVisibleNavigateTwo
  63. {
  64. get => isVisibleNavigateTwo;
  65. set => SetProperty(ref isVisibleNavigateTwo, value);
  66. }
  67. public void Delete()
  68. {
  69. GameCreateFriendVM.Delete(Id);
  70. }
  71. }
  72. }