StatusPlot.xaml.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. using System.Reflection.Metadata.Ecma335;
  2. namespace HistoryView.Controls;
  3. public partial class StatusPlot : UserControl
  4. {
  5. public StatusPlot()
  6. {
  7. InitializeComponent();
  8. }
  9. public UserInformation User
  10. {
  11. get { return (UserInformation)GetValue(UserProperty); }
  12. set { SetValue(UserProperty, value); }
  13. }
  14. // Using a DependencyProperty as the backing store for User. This enables animation, styling, binding, etc...
  15. public static readonly DependencyProperty UserProperty =
  16. DependencyProperty.Register("User", typeof(UserInformation), typeof(StatusPlot), new PropertyMetadata(default));
  17. public Mini8Info DataSource
  18. {
  19. get { return (Mini8Info)GetValue(DataSourceProperty); }
  20. set { SetValue(DataSourceProperty, value); }
  21. }
  22. public static readonly DependencyProperty DataSourceProperty =
  23. DependencyProperty.Register("DataSource", typeof(Mini8Info), typeof(StatusPlot), new PropertyMetadata(default));
  24. public IEnumerable<Channel> Channels
  25. {
  26. get { return (IEnumerable<Channel>)GetValue(ChannelsProperty); }
  27. set { SetValue(ChannelsProperty, value); }
  28. }
  29. public static readonly DependencyProperty ChannelsProperty =
  30. DependencyProperty.Register("Channels", typeof(IEnumerable<Channel>), typeof(StatusPlot), new PropertyMetadata(default));
  31. public ICommand EditChannel
  32. {
  33. get { return (ICommand)GetValue(EditChannelProperty); }
  34. set { SetValue(EditChannelProperty, value); }
  35. }
  36. public static readonly DependencyProperty EditChannelProperty =
  37. DependencyProperty.Register("EditChannel", typeof(ICommand), typeof(StatusPlot), new PropertyMetadata(default));
  38. public ICommand Reconnect
  39. {
  40. get { return (ICommand)GetValue(ReconnectProperty); }
  41. set { SetValue(ReconnectProperty, value); }
  42. }
  43. public static readonly DependencyProperty ReconnectProperty =
  44. DependencyProperty.Register("Reconnect", typeof(ICommand), typeof(StatusPlot), new PropertyMetadata(default));
  45. public ICommand MultiSelectCommand
  46. {
  47. get { return (ICommand)GetValue(MultiSelectCommandProperty); }
  48. set { SetValue(MultiSelectCommandProperty, value); }
  49. }
  50. // Using a DependencyProperty as the backing store for MultiSelectCommand. This enables animation, styling, binding, etc...
  51. public static readonly DependencyProperty MultiSelectCommandProperty =
  52. DependencyProperty.Register("MultiSelectCommand", typeof(ICommand), typeof(StatusPlot), new PropertyMetadata(default));
  53. public ICommand TraceLogCommand
  54. {
  55. get { return (ICommand)GetValue(TraceLogCommandProperty); }
  56. set { SetValue(TraceLogCommandProperty, value); }
  57. }
  58. // Using a DependencyProperty as the backing store for TraceLogCommand. This enables animation, styling, binding, etc...
  59. public static readonly DependencyProperty TraceLogCommandProperty =
  60. DependencyProperty.Register("TraceLogCommand", typeof(ICommand), typeof(StatusPlot), new PropertyMetadata(default));
  61. public ICommand MultiTraceCommand
  62. {
  63. get { return (ICommand)GetValue(MultiTraceCommandProperty); }
  64. set { SetValue(MultiTraceCommandProperty, value); }
  65. }
  66. // Using a DependencyProperty as the backing store for MultiTraceCommand. This enables animation, styling, binding, etc...
  67. public static readonly DependencyProperty MultiTraceCommandProperty =
  68. DependencyProperty.Register("MultiTraceCommand", typeof(ICommand), typeof(StatusPlot), new PropertyMetadata(default));
  69. public object ReconnectParameter
  70. {
  71. get { return (object)GetValue(ReconnectParameterProperty); }
  72. set { SetValue(ReconnectParameterProperty, value); }
  73. }
  74. public static readonly DependencyProperty ReconnectParameterProperty =
  75. DependencyProperty.Register("ReconnectParameter", typeof(object), typeof(StatusPlot), new PropertyMetadata(default));
  76. public object EditParameter
  77. {
  78. get { return (object)GetValue(EditParameterProperty); }
  79. set { SetValue(EditParameterProperty, value); }
  80. }
  81. public static readonly DependencyProperty EditParameterProperty =
  82. DependencyProperty.Register("EditParameter", typeof(object), typeof(StatusPlot), new PropertyMetadata(default));
  83. public int Rows
  84. {
  85. get { return (int)GetValue(RowsProperty); }
  86. set { SetValue(RowsProperty, value); }
  87. }
  88. public static readonly DependencyProperty RowsProperty =
  89. DependencyProperty.Register("Rows", typeof(int), typeof(StatusPlot), new PropertyMetadata(1));
  90. private void FunctionButton_Click(object sender, RoutedEventArgs e)
  91. {
  92. this.FunctionPop.IsOpen = !this.FunctionPop.IsOpen;
  93. }
  94. private void Button_Click(object sender, RoutedEventArgs e)
  95. {
  96. this.FunctionPop.IsOpen = false;
  97. }
  98. private void Button_Click_1(object sender, RoutedEventArgs e)
  99. {
  100. DataSource.Enable = true;
  101. }
  102. private void Button_Click_2(object sender, RoutedEventArgs e)
  103. {
  104. DataSource.Enable = false;
  105. }
  106. }