Buffer.xaml.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection.Metadata.Ecma335;
  5. using System.Runtime.CompilerServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace SummaryModule.Controls.BaseMotion;
  18. /// <summary>
  19. /// Interaction logic for Buffer.xaml
  20. /// </summary>
  21. public partial class Buffer : UserControl
  22. {
  23. public Buffer()
  24. {
  25. InitializeComponent();
  26. }
  27. public string Type
  28. {
  29. get { return (string)GetValue(TypeProperty); }
  30. set { SetValue(TypeProperty, value); }
  31. }
  32. // Using a DependencyProperty as the backing store for Type. This enables animation, styling, binding, etc...
  33. public static readonly DependencyProperty TypeProperty =
  34. DependencyProperty.Register(nameof(Type), typeof(string), typeof(Buffer), new PropertyMetadata(default));
  35. public string Placement
  36. {
  37. get { return (string)GetValue(PlacementProperty); }
  38. set { SetValue(PlacementProperty, value); }
  39. }
  40. // Using a DependencyProperty as the backing store for Placement. This enables animation, styling, binding, etc...
  41. public static readonly DependencyProperty PlacementProperty =
  42. DependencyProperty.Register(nameof(Placement), typeof(string), typeof(Buffer), new PropertyMetadata(default));
  43. public ICommand Command
  44. {
  45. get { return (ICommand)GetValue(CommandProperty); }
  46. set { SetValue(CommandProperty, value); }
  47. }
  48. // Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc...
  49. public static readonly DependencyProperty CommandProperty =
  50. DependencyProperty.Register(nameof(Command), typeof(ICommand), typeof(Buffer), new PropertyMetadata(default));
  51. public object CommandParameter
  52. {
  53. get { return (object)GetValue(CommandParameterProperty); }
  54. set { SetValue(CommandParameterProperty, value); }
  55. }
  56. // Using a DependencyProperty as the backing store for CommandParameter. This enables animation, styling, binding, etc...
  57. public static readonly DependencyProperty CommandParameterProperty =
  58. DependencyProperty.Register(nameof(CommandParameter), typeof(object), typeof(Buffer), new PropertyMetadata(default));
  59. public bool IsActive
  60. {
  61. get { return (bool)GetValue(IsActiveProperty); }
  62. set { SetValue(IsActiveProperty, value); }
  63. }
  64. // Using a DependencyProperty as the backing store for IsActive. This enables animation, styling, binding, etc...
  65. public static readonly DependencyProperty IsActiveProperty =
  66. DependencyProperty.Register(nameof(IsActive), typeof(bool), typeof(Buffer), new PropertyMetadata(false, PropertyChangedCallback));
  67. static void PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
  68. {
  69. if (d is not Buffer buffer)
  70. return;
  71. if (e.NewValue is not bool input)
  72. return;
  73. //buffer.active
  74. //buffer.ActiveLight
  75. //buffer.
  76. }
  77. public bool FoupLoaded
  78. {
  79. get { return (bool)GetValue(FoupLoadedProperty); }
  80. set { SetValue(FoupLoadedProperty, value); }
  81. }
  82. // Using a DependencyProperty as the backing store for FoupLoaded. This enables animation, styling, binding, etc...
  83. public static readonly DependencyProperty FoupLoadedProperty =
  84. DependencyProperty.Register(nameof(FoupLoaded), typeof(bool), typeof(Buffer), new PropertyMetadata(false));
  85. }