EventView.xaml.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. }