MainWindow.xaml.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using MyWPFControl.Controls;
  2. using System.Text;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Data;
  6. using System.Windows.Documents;
  7. using System.Windows.Input;
  8. using System.Windows.Media;
  9. using System.Windows.Media.Imaging;
  10. using System.Windows.Navigation;
  11. using System.Windows.Shapes;
  12. namespace B20UVLog
  13. {
  14. /// <summary>
  15. /// Interaction logic for MainWindow.xaml
  16. /// </summary>
  17. public partial class MainWindow : MWindow
  18. {
  19. public MainWindow()
  20. {
  21. InitializeComponent();
  22. //FrameContent.Source = new Uri("Pages/AxisData.xaml", UriKind.RelativeOrAbsolute);
  23. }
  24. private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
  25. {
  26. TreeView treeView = sender as TreeView;
  27. MTreeViewItem treeViewItem = treeView.SelectedItem as MTreeViewItem;
  28. switch (treeViewItem.Header.ToString())
  29. {
  30. case "Axis Data":
  31. FrameContent.Source = new Uri("Pages/AxisData.xaml", UriKind.RelativeOrAbsolute);
  32. break;
  33. case "Servo Axis Status":
  34. FrameContent.Source = new Uri("Pages/ServoAxisStatus.xaml", UriKind.RelativeOrAbsolute);
  35. break;
  36. case "Glass Information":
  37. FrameContent.Source = new Uri("Pages/GlassInformation.xaml", UriKind.RelativeOrAbsolute);
  38. break;
  39. case "Lamp Use Time":
  40. FrameContent.Source = new Uri("Pages/LampUseTime.xaml", UriKind.RelativeOrAbsolute);
  41. break;
  42. case "Recipe Body":
  43. FrameContent.Source = new Uri("Pages/RecipeBody.xaml", UriKind.RelativeOrAbsolute);
  44. break;
  45. case "SYS Para":
  46. FrameContent.Source = new Uri("Pages/SYSPara.xaml", UriKind.RelativeOrAbsolute);
  47. break;
  48. case "Robot Interface":
  49. FrameContent.Source = new Uri("Pages/RobotInterface.xaml", UriKind.RelativeOrAbsolute);
  50. break;
  51. case "Y Measure Data":
  52. FrameContent.Source = new Uri("Pages/YMeasureData.xaml", UriKind.RelativeOrAbsolute);
  53. break;
  54. case "EQP Status":
  55. FrameContent.Source = new Uri("Pages/EQPStatus.xaml", UriKind.RelativeOrAbsolute);
  56. break;
  57. case "Recipe Count":
  58. FrameContent.Source = new Uri("Pages/RecipeCount.xaml", UriKind.RelativeOrAbsolute);
  59. break;
  60. case "ANALog Data":
  61. FrameContent.Source = new Uri("Pages/ANALogData.xaml", UriKind.RelativeOrAbsolute);
  62. break;
  63. case "Alarm":
  64. FrameContent.Source = new Uri("Pages/Alarm.xaml", UriKind.RelativeOrAbsolute);
  65. break;
  66. case "IO":
  67. FrameContent.Source = new Uri("Pages/IO.xaml", UriKind.RelativeOrAbsolute);
  68. break;
  69. default:
  70. FrameContent.Source = null;
  71. break;
  72. }
  73. }
  74. }
  75. }