EventView.xaml.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. using System.Collections.Generic;
  2. using System.Windows;
  3. using System.Windows.Controls;
  4. namespace MECF.Framework.UI.Client.CenterViews.DataLogs.Event
  5. {
  6. /// <summary>
  7. /// EventView.xaml 的交互逻辑
  8. /// </summary>
  9. public delegate void ItemSelectionChange(bool changeFalg);
  10. public class ItemSelectionData
  11. {
  12. public bool _IsSelcet;
  13. public string _SelectItem;
  14. public bool IsSelect { get { return _IsSelcet; } set { _IsSelcet = value; } }
  15. public string SelectItem { get { return _SelectItem; } set { _SelectItem = value; } }
  16. public ItemSelectionData(bool IsSelcet,string SelectItem)
  17. {
  18. this.IsSelect = IsSelcet;
  19. this.SelectItem = SelectItem;
  20. }
  21. }
  22. public partial class EventView : UserControl
  23. {
  24. public EventView()
  25. {
  26. InitializeComponent();
  27. tbLoadPort1ToolTipList = new List<string>();
  28. }
  29. public List<string> tbLoadPort1ToolTipList { get; set; }
  30. public static readonly DependencyProperty tbLoadPort1ToolTipValueProperty = DependencyProperty.Register(
  31. "tbLoadPort1ToolTipValueData", typeof(ItemSelectionData), typeof(EventView));
  32. public ItemSelectionData tbLoadPort1ToolTipValueData
  33. {
  34. get { return (ItemSelectionData)this.GetValue(tbLoadPort1ToolTipValueProperty); }
  35. set { SetValue(tbLoadPort1ToolTipValueProperty, value); }
  36. }
  37. private void tbLoadPort1_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
  38. {
  39. if (e.Item != null)
  40. {
  41. //if(e.Item.ToString()=="ALL")
  42. tbLoadPort1ToolTipValueData= new ItemSelectionData(e.IsSelected,e.Item.ToString());
  43. }
  44. else
  45. {
  46. tbLoadPort1ToolTipValueData = null;
  47. }
  48. }
  49. }
  50. [TemplateVisualState(Name = "Large", GroupName = "SizeStates")]
  51. [TemplateVisualState(Name = "Small", GroupName = "SizeStates")]
  52. [TemplateVisualState(Name = "Inactive", GroupName = "ActiveStates")]
  53. [TemplateVisualState(Name = "Active", GroupName = "ActiveStates")]
  54. public partial class CirclePointRingLoading : Control
  55. {
  56. // Token: 0x17000001 RID: 1
  57. // (get) Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
  58. // (set) Token: 0x06000002 RID: 2 RVA: 0x00002072 File Offset: 0x00000272
  59. public double BindableWidth
  60. {
  61. get
  62. {
  63. return (double)base.GetValue(CirclePointRingLoading.BindableWidthProperty);
  64. }
  65. private set
  66. {
  67. base.SetValue(CirclePointRingLoading.BindableWidthProperty, value);
  68. }
  69. }
  70. // Token: 0x06000003 RID: 3 RVA: 0x00002088 File Offset: 0x00000288
  71. private static void BindableWidthCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
  72. {
  73. CirclePointRingLoading circlePointRingLoading = dependencyObject as CirclePointRingLoading;
  74. bool flag = circlePointRingLoading == null;
  75. if (!flag)
  76. {
  77. circlePointRingLoading.SetEllipseDiameter((double)e.NewValue);
  78. circlePointRingLoading.SetEllipseOffset((double)e.NewValue);
  79. circlePointRingLoading.SetMaxSideLength((double)e.NewValue);
  80. }
  81. }
  82. // Token: 0x06000004 RID: 4 RVA: 0x000020E0 File Offset: 0x000002E0
  83. private void SetEllipseDiameter(double width)
  84. {
  85. this.EllipseDiameter = width / 8.0;
  86. }
  87. // Token: 0x06000005 RID: 5 RVA: 0x000020F5 File Offset: 0x000002F5
  88. private void SetEllipseOffset(double width)
  89. {
  90. this.EllipseOffset = new Thickness(0.0, width / 2.0, 0.0, 0.0);
  91. }
  92. // Token: 0x06000006 RID: 6 RVA: 0x0000212A File Offset: 0x0000032A
  93. private void SetMaxSideLength(double width)
  94. {
  95. this.MaxSideLength = ((width <= 20.0) ? 20.0 : width);
  96. }
  97. // Token: 0x17000002 RID: 2
  98. // (get) Token: 0x06000007 RID: 7 RVA: 0x0000214C File Offset: 0x0000034C
  99. // (set) Token: 0x06000008 RID: 8 RVA: 0x0000216E File Offset: 0x0000036E
  100. public bool IsActive
  101. {
  102. get
  103. {
  104. return (bool)base.GetValue(CirclePointRingLoading.IsActiveProperty);
  105. }
  106. set
  107. {
  108. base.SetValue(CirclePointRingLoading.IsActiveProperty, value);
  109. }
  110. }
  111. // Token: 0x06000009 RID: 9 RVA: 0x00002184 File Offset: 0x00000384
  112. private static void IsActiveChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
  113. {
  114. CirclePointRingLoading circlePointRingLoading = sender as CirclePointRingLoading;
  115. bool flag = circlePointRingLoading == null;
  116. if (!flag)
  117. {
  118. circlePointRingLoading.UpdateActiveState();
  119. }
  120. }
  121. // Token: 0x0600000A RID: 10 RVA: 0x000021AC File Offset: 0x000003AC
  122. private void UpdateActiveState()
  123. {
  124. bool isActive = this.IsActive;
  125. if (isActive)
  126. {
  127. VisualStateManager.GoToState(this, this.StateActive, true);
  128. }
  129. else
  130. {
  131. VisualStateManager.GoToState(this, this.StateInActive, true);
  132. }
  133. }
  134. // Token: 0x17000003 RID: 3
  135. // (get) Token: 0x0600000B RID: 11 RVA: 0x000021E4 File Offset: 0x000003E4
  136. // (set) Token: 0x0600000C RID: 12 RVA: 0x00002206 File Offset: 0x00000406
  137. public bool IsLarge
  138. {
  139. get
  140. {
  141. return (bool)base.GetValue(CirclePointRingLoading.IsLargeProperty);
  142. }
  143. set
  144. {
  145. base.SetValue(CirclePointRingLoading.IsLargeProperty, value);
  146. }
  147. }
  148. // Token: 0x0600000D RID: 13 RVA: 0x0000221C File Offset: 0x0000041C
  149. private static void IsLargeChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
  150. {
  151. CirclePointRingLoading circlePointRingLoading = sender as CirclePointRingLoading;
  152. bool flag = circlePointRingLoading == null;
  153. if (!flag)
  154. {
  155. circlePointRingLoading.UpdateLargeState();
  156. }
  157. }
  158. // Token: 0x0600000E RID: 14 RVA: 0x00002244 File Offset: 0x00000444
  159. private void UpdateLargeState()
  160. {
  161. bool isLarge = this.IsLarge;
  162. if (isLarge)
  163. {
  164. VisualStateManager.GoToState(this, this.StateLarge, true);
  165. }
  166. else
  167. {
  168. VisualStateManager.GoToState(this, this.StateSmall, true);
  169. }
  170. }
  171. // Token: 0x17000004 RID: 4
  172. // (get) Token: 0x0600000F RID: 15 RVA: 0x0000227C File Offset: 0x0000047C
  173. // (set) Token: 0x06000010 RID: 16 RVA: 0x0000229E File Offset: 0x0000049E
  174. public double MaxSideLength
  175. {
  176. get
  177. {
  178. return (double)base.GetValue(CirclePointRingLoading.MaxSideLengthProperty);
  179. }
  180. set
  181. {
  182. base.SetValue(CirclePointRingLoading.MaxSideLengthProperty, value);
  183. }
  184. }
  185. // Token: 0x17000005 RID: 5
  186. // (get) Token: 0x06000011 RID: 17 RVA: 0x000022B4 File Offset: 0x000004B4
  187. // (set) Token: 0x06000012 RID: 18 RVA: 0x000022D6 File Offset: 0x000004D6
  188. public double EllipseDiameter
  189. {
  190. get
  191. {
  192. return (double)base.GetValue(CirclePointRingLoading.EllipseDiameterProperty);
  193. }
  194. set
  195. {
  196. base.SetValue(CirclePointRingLoading.EllipseDiameterProperty, value);
  197. }
  198. }
  199. // Token: 0x17000006 RID: 6
  200. // (get) Token: 0x06000013 RID: 19 RVA: 0x000022EC File Offset: 0x000004EC
  201. // (set) Token: 0x06000014 RID: 20 RVA: 0x0000230E File Offset: 0x0000050E
  202. public Thickness EllipseOffset
  203. {
  204. get
  205. {
  206. return (Thickness)base.GetValue(CirclePointRingLoading.EllipseOffsetProperty);
  207. }
  208. set
  209. {
  210. base.SetValue(CirclePointRingLoading.EllipseOffsetProperty, value);
  211. }
  212. }
  213. // Token: 0x06000015 RID: 21 RVA: 0x00002324 File Offset: 0x00000524
  214. public CirclePointRingLoading()
  215. {
  216. base.SizeChanged += new SizeChangedEventHandler((object argument0, SizeChangedEventArgs argument1) => this.BindableWidth = base.ActualWidth);
  217. }
  218. // Token: 0x06000016 RID: 22 RVA: 0x00002378 File Offset: 0x00000578
  219. static CirclePointRingLoading()
  220. {
  221. FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(CirclePointRingLoading), new FrameworkPropertyMetadata(typeof(CirclePointRingLoading)));
  222. UIElement.VisibilityProperty.OverrideMetadata(typeof(CirclePointRingLoading), new FrameworkPropertyMetadata(delegate (DependencyObject ringObject, DependencyPropertyChangedEventArgs e)
  223. {
  224. bool flag = e.NewValue != e.OldValue;
  225. if (flag)
  226. {
  227. CirclePointRingLoading circlePointRingLoading = (CirclePointRingLoading)ringObject;
  228. bool flag2 = (Visibility)e.NewValue > Visibility.Visible;
  229. if (flag2)
  230. {
  231. circlePointRingLoading.SetCurrentValue(CirclePointRingLoading.IsActiveProperty, false);
  232. }
  233. else
  234. {
  235. circlePointRingLoading.IsActive = true;
  236. }
  237. }
  238. }));
  239. }
  240. // Token: 0x06000017 RID: 23 RVA: 0x00002531 File Offset: 0x00000731
  241. public override void OnApplyTemplate()
  242. {
  243. base.OnApplyTemplate();
  244. this.UpdateLargeState();
  245. this.UpdateActiveState();
  246. }
  247. // Token: 0x04000001 RID: 1
  248. private string StateActive = "Active";
  249. // Token: 0x04000002 RID: 2
  250. private string StateInActive = "InActive";
  251. // Token: 0x04000003 RID: 3
  252. private string StateLarge = "Large";
  253. // Token: 0x04000004 RID: 4
  254. private string StateSmall = "Small";
  255. // Token: 0x04000005 RID: 5
  256. public static readonly DependencyProperty BindableWidthProperty = DependencyProperty.Register("BindableWidth", typeof(double), typeof(CirclePointRingLoading), new PropertyMetadata(0.0, new PropertyChangedCallback(CirclePointRingLoading.BindableWidthCallback)));
  257. // Token: 0x04000006 RID: 6
  258. public static readonly DependencyProperty IsActiveProperty = DependencyProperty.Register("IsActive", typeof(bool), typeof(CirclePointRingLoading), new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(CirclePointRingLoading.IsActiveChanged)));
  259. // Token: 0x04000007 RID: 7
  260. public static readonly DependencyProperty IsLargeProperty = DependencyProperty.Register("IsLarge", typeof(bool), typeof(CirclePointRingLoading), new PropertyMetadata(true, new PropertyChangedCallback(CirclePointRingLoading.IsLargeChangedCallback)));
  261. // Token: 0x04000008 RID: 8
  262. public static readonly DependencyProperty MaxSideLengthProperty = DependencyProperty.Register("MaxSideLength", typeof(double), typeof(CirclePointRingLoading), new PropertyMetadata(0.0));
  263. // Token: 0x04000009 RID: 9
  264. public static readonly DependencyProperty EllipseDiameterProperty = DependencyProperty.Register("EllipseDiameter", typeof(double), typeof(CirclePointRingLoading), new PropertyMetadata(0.0));
  265. // Token: 0x0400000A RID: 10
  266. public static readonly DependencyProperty EllipseOffsetProperty = DependencyProperty.Register("EllipseOffset", typeof(Thickness), typeof(CirclePointRingLoading), new PropertyMetadata(default(Thickness)));
  267. }
  268. }