MonitorView.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using Aitex.Core.Util;
  15. namespace Aitex.Core.UI.View.Common
  16. {
  17. /// <summary>
  18. /// Interaction logic for MonitorView.xaml
  19. /// </summary>
  20. public partial class MonitorView : UserControl
  21. {
  22. public MonitorView()
  23. {
  24. InitializeComponent();
  25. IsVisibleChanged += new DependencyPropertyChangedEventHandler(MainWindow_IsVisibleChanged);
  26. }
  27. void MainWindow_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  28. {
  29. }
  30. /// <summary>
  31. /// Alarm, Warning selected item changed
  32. /// </summary>
  33. /// <param name="sender"></param>
  34. /// <param name="e"></param>
  35. private void listView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
  36. {
  37. if (e.AddedItems.Count == 1)
  38. {
  39. var item = e.AddedItems[0] as AlarmItem;
  40. AnalysisText.Text = string.Format("Event Type:{0}\r\n\r\nEvent Name:{1}\r\n\r\nTime:{2}\r\n\r\nDescription:{3}",
  41. item.Type,
  42. item.EventEnum,
  43. //item.EventId, Event Number:{ 2}\r\n\r\n
  44. item.OccuringTime,
  45. item.Description);
  46. //item.Solution);\r\n\r\nSolution:{ 5}
  47. }
  48. else
  49. {
  50. AnalysisText.Text = string.Empty;
  51. }
  52. }
  53. }
  54. }