ModuleAlarmView.xaml.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Windows.Controls;
  3. using System.Windows.Data;
  4. using System.Windows.Media;
  5. using Aitex.Core.UI.View.Common;
  6. namespace MECF.Framework.UI.Client.CenterViews.Alarms.ModuleAlarm
  7. {
  8. /// <summary>
  9. /// ModuleAlarmView.xaml 的交互逻辑
  10. /// </summary>
  11. public partial class ModuleAlarmView : UserControl
  12. {
  13. public ModuleAlarmView()
  14. {
  15. InitializeComponent();
  16. }
  17. private void listView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
  18. {
  19. //if (e.AddedItems.Count == 1)
  20. //{
  21. // var item = e.AddedItems[0] as AlarmItem;
  22. // AnalysisText.Text = string.Format("Event Type:{0}\r\n\r\nEvent Name:{1}\r\n\r\nTime:{2}\r\n\r\nDescription:{3}",
  23. // item.Type,
  24. // item.EventEnum,
  25. // //item.EventId, Event Number:{ 2}\r\n\r\n
  26. // item.OccuringTime,
  27. // item.Description
  28. // //item.Solution \r\n\r\nSolution:{ 5}
  29. // );
  30. //}
  31. //else
  32. //{
  33. // AnalysisText.Text = string.Empty;
  34. //}
  35. }
  36. }
  37. public class TypeColorConverter : IValueConverter
  38. {
  39. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  40. {
  41. switch ((string)value)
  42. {
  43. case "Alarm": return Brushes.Red;
  44. case "Warning": return Brushes.Yellow;
  45. }
  46. return Brushes.Transparent;
  47. }
  48. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  49. {
  50. return null;
  51. }
  52. }
  53. }