SRDFlipperControl.xaml.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using MECF.Framework.Common.CommonData.SRD;
  2. using MECF.Framework.Common.OperationCenter;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  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 CyberX8_Themes.UserControls
  18. {
  19. /// <summary>
  20. /// SRDFlipperControl.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class SRDFlipperControl : UserControl
  23. {
  24. public SRDFlipperControl()
  25. {
  26. InitializeComponent();
  27. }
  28. public static readonly DependencyProperty ModuleNameProperty = DependencyProperty.Register(
  29. "ModuleName", typeof(string), typeof(SRDFlipperControl),
  30. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  31. /// <summary>
  32. /// 模块名称
  33. /// </summary>
  34. public string ModuleName
  35. {
  36. get
  37. {
  38. return (string)this.GetValue(ModuleNameProperty);
  39. }
  40. set
  41. {
  42. this.SetValue(ModuleNameProperty, value);
  43. }
  44. }
  45. public static readonly DependencyProperty CommonDataProperty = DependencyProperty.Register(
  46. "CommonData", typeof(SrdCommonData), typeof(SRDFlipperControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  47. /// <summary>
  48. /// CommonData
  49. /// </summary>
  50. public SrdCommonData CommonData
  51. {
  52. get
  53. {
  54. return (SrdCommonData)this.GetValue(CommonDataProperty);
  55. }
  56. set
  57. {
  58. this.SetValue(CommonDataProperty, value);
  59. }
  60. }
  61. #region Operation
  62. private void FlipperIn150_Click(object sender, RoutedEventArgs e)
  63. {
  64. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperIn", 150);
  65. }
  66. private void FlipperOut150_Click(object sender, RoutedEventArgs e)
  67. {
  68. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperOut", 150);
  69. }
  70. private void FlipperIn200_Click(object sender, RoutedEventArgs e)
  71. {
  72. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperIn", 200);
  73. }
  74. private void FlipperOut200_Click(object sender, RoutedEventArgs e)
  75. {
  76. InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperOut", 200);
  77. }
  78. //private void FlipperIn100_Click(object sender, RoutedEventArgs e)
  79. //{
  80. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperIn", 100);
  81. //}
  82. //private void FlipperOut100_Click(object sender, RoutedEventArgs e)
  83. //{
  84. // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Common.FlipperOut", 100);
  85. //}
  86. #endregion
  87. }
  88. }