ScStringRow.xaml.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Input;
  4. namespace MECF.Framework.UI.Client.CenterViews.Controls
  5. {
  6. /// <summary>
  7. /// AITSCRow.xaml 的交互逻辑
  8. /// </summary>
  9. public partial class ScStringRow : UserControl
  10. {
  11. public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(
  12. "Command", typeof(ICommand), typeof(ScStringRow),
  13. new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));
  14. public ICommand Command
  15. {
  16. get
  17. {
  18. return (ICommand)this.GetValue(CommandProperty);
  19. }
  20. set
  21. {
  22. this.SetValue(CommandProperty, value);
  23. }
  24. }
  25. public static readonly DependencyProperty NameWidthProperty = DependencyProperty.Register(
  26. "NameWidth", typeof(int), typeof(ScStringRow),
  27. new FrameworkPropertyMetadata(180, FrameworkPropertyMetadataOptions.AffectsRender));
  28. public int NameWidth
  29. {
  30. get
  31. {
  32. return (int)this.GetValue(NameWidthProperty);
  33. }
  34. set
  35. {
  36. this.SetValue(NameWidthProperty, value);
  37. }
  38. }
  39. public static readonly DependencyProperty FeedbackWidthProperty = DependencyProperty.Register(
  40. "FeedbackWidth", typeof(int), typeof(ScStringRow),
  41. new FrameworkPropertyMetadata(90, FrameworkPropertyMetadataOptions.AffectsRender));
  42. public int FeedbackWidth
  43. {
  44. get
  45. {
  46. return (int)this.GetValue(FeedbackWidthProperty);
  47. }
  48. set
  49. {
  50. this.SetValue(FeedbackWidthProperty, value);
  51. }
  52. }
  53. public static readonly DependencyProperty SetPointWidthProperty = DependencyProperty.Register(
  54. "SetPointWidth", typeof(int), typeof(ScStringRow),
  55. new FrameworkPropertyMetadata(90, FrameworkPropertyMetadataOptions.AffectsRender));
  56. public int SetPointWidth
  57. {
  58. get
  59. {
  60. return (int)this.GetValue(SetPointWidthProperty);
  61. }
  62. set
  63. {
  64. this.SetValue(SetPointWidthProperty, value);
  65. }
  66. }
  67. public static readonly DependencyProperty CommandWidthProperty = DependencyProperty.Register(
  68. "CommandWidth", typeof(int), typeof(ScStringRow),
  69. new FrameworkPropertyMetadata(90, FrameworkPropertyMetadataOptions.AffectsRender));
  70. public int CommandWidth
  71. {
  72. get
  73. {
  74. return (int)this.GetValue(CommandWidthProperty);
  75. }
  76. set
  77. {
  78. this.SetValue(CommandWidthProperty, value);
  79. }
  80. }
  81. public static readonly DependencyProperty ScIdProperty = DependencyProperty.Register(
  82. "ScId", typeof(string), typeof(ScStringRow),
  83. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  84. public string ScId
  85. {
  86. get
  87. {
  88. return (string)this.GetValue(ScIdProperty);
  89. }
  90. set
  91. {
  92. this.SetValue(ScIdProperty, value);
  93. }
  94. }
  95. public static readonly DependencyProperty ScNameProperty = DependencyProperty.Register(
  96. "ScName", typeof(string), typeof(ScStringRow),
  97. new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.AffectsRender));
  98. public string ScName
  99. {
  100. get
  101. {
  102. return (string)this.GetValue(ScNameProperty);
  103. }
  104. set
  105. {
  106. this.SetValue(ScNameProperty, value);
  107. }
  108. }
  109. public static readonly DependencyProperty ScFeedbackProperty = DependencyProperty.Register(
  110. "ScFeedback", typeof(string), typeof(ScStringRow),
  111. new FrameworkPropertyMetadata("127.0.0.1", FrameworkPropertyMetadataOptions.AffectsRender));
  112. public double ScFeedback
  113. {
  114. get
  115. {
  116. return (double)this.GetValue(ScFeedbackProperty);
  117. }
  118. set
  119. {
  120. this.SetValue(ScFeedbackProperty, value);
  121. }
  122. }
  123. public static readonly DependencyProperty ScSetPointProperty = DependencyProperty.Register(
  124. "ScSetPoint", typeof(string), typeof(ScStringRow),
  125. new FrameworkPropertyMetadata("127.0.0.1", FrameworkPropertyMetadataOptions.AffectsRender));
  126. public string ScSetPoint
  127. {
  128. get
  129. {
  130. return (string)this.GetValue(ScSetPointProperty);
  131. }
  132. set
  133. {
  134. this.SetValue(ScSetPointProperty, value);
  135. }
  136. }
  137. public ScStringRow()
  138. {
  139. InitializeComponent();
  140. }
  141. private void Button_Click(object sender, RoutedEventArgs e)
  142. {
  143. Command.Execute(new object[] { ScId, ScSetPoint.ToString()});
  144. }
  145. }
  146. }