EventView.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <UserControl x:Class="CyberX8_MainPages.Views.EventView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:CyberX8_MainPages.Views"
  7. xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  8. xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
  9. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  10. xmlns:prism="http://prismlibrary.com/"
  11. xmlns:converters="clr-namespace:CyberX8_Themes.Converters;assembly=CyberX8_Themes"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. mc:Ignorable="d"
  14. d:DesignHeight="450" d:DesignWidth="800" x:Name="eventView">
  15. <UserControl.Resources>
  16. <converters:BoolToBool x:Key="BoolToBool"/>
  17. </UserControl.Resources>
  18. <i:Interaction.Triggers>
  19. <i:EventTrigger EventName="Loaded">
  20. <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=eventView}"/>
  21. </i:EventTrigger>
  22. </i:Interaction.Triggers>
  23. <Grid HorizontalAlignment="Left">
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="260" />
  26. <ColumnDefinition Width="*" />
  27. </Grid.ColumnDefinitions>
  28. <Grid Grid.Column="0">
  29. <Grid.RowDefinitions>
  30. <RowDefinition Height="34"/>
  31. <RowDefinition Height="24"/>
  32. <RowDefinition Height="Auto"/>
  33. <RowDefinition Height="Auto"/>
  34. <RowDefinition Height="Auto"/>
  35. <RowDefinition Height="Auto"/>
  36. <RowDefinition Height="Auto"/>
  37. <RowDefinition Height="Auto"/>
  38. </Grid.RowDefinitions>
  39. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,1,1,0" Background="{DynamicResource Table_BG_Title}">
  40. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  41. <RadioButton Content="Manual" IsChecked="{Binding IsAuto,Converter={StaticResource BoolToBool}}" FontSize="18"/>
  42. <RadioButton Content="Auto" IsChecked="{Binding IsAuto}" FontSize="18" Margin="5,0,0,0"/>
  43. </StackPanel>
  44. </Border>
  45. <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
  46. <TextBlock Text="Query Condition" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  47. </Border>
  48. <Border Grid.Row="2" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  49. <StackPanel Margin="0,5">
  50. <StackPanel Orientation="Horizontal">
  51. <TextBlock Text="Start Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  52. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
  53. <wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  54. </wfi:WindowsFormsHost>
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
  57. <TextBlock Text="End Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  58. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" VerticalAlignment="Center">
  59. <wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  60. </wfi:WindowsFormsHost>
  61. </StackPanel>
  62. </StackPanel>
  63. </Border>
  64. <Border Grid.Row="3" Margin="0,5,0,0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="30">
  65. <TextBlock Text="Query Option" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  66. </Border>
  67. <Border Grid.Row="4" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  68. <UniformGrid Columns="2" Margin="0,5">
  69. <CheckBox Content="Alarm" IsChecked="{Binding SearchAlarmEvent}" FontSize="14"/>
  70. <CheckBox Content="Warning" IsChecked="{Binding SearchWarningEvent}" FontSize="14"/>
  71. <CheckBox Content="Information" IsChecked="{Binding SearchInfoEvent}" FontSize="14"/>
  72. <!--<CheckBox Content="Operation" Height="Auto" IsChecked="{Binding SearchOpeLog}" FontSize="14" />-->
  73. </UniformGrid>
  74. </Border>
  75. <Border Grid.Row="5" Margin="0,5,0,0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Height="30">
  76. <TextBlock Text="Extra Condition" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  77. </Border>
  78. <Border Grid.Row="6" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  79. <StackPanel Orientation="Horizontal" Margin="0,5">
  80. <TextBlock Text="Key Words" Name="checkBox3" Tag="ReactorC" FontFamily="Arial" FontSize="14" VerticalAlignment="Center"/>
  81. <TextBox Margin="5,0,0,0" FontSize="14" Text="{Binding SearchKeyWords,UpdateSourceTrigger=PropertyChanged}" Width="170"/>
  82. </StackPanel>
  83. </Border>
  84. <StackPanel Grid.Row="7" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,20">
  85. <Button Width="100" Height="30" FontFamily="Arial" Content="Query" Command="{Binding SearchCommand}" IsEnabled="{Binding IsAuto,Converter={StaticResource BoolToBool}}">
  86. <!--<i:Interaction.Triggers>
  87. <i:EventTrigger EventName="Click">
  88. <cal:ActionMessage MethodName="Search">
  89. </cal:ActionMessage>
  90. </i:EventTrigger>
  91. </i:Interaction.Triggers>-->
  92. </Button>
  93. <Button Width="100" Height="30" Margin="0,5,0,0" FontFamily="Arial" Content="Export" Command="{Binding ExportCommand}" IsEnabled="{Binding IsAuto,Converter={StaticResource BoolToBool}}">
  94. <!--<i:Interaction.Triggers>
  95. <i:EventTrigger EventName="Click">
  96. <cal:ActionMessage MethodName="Export">
  97. </cal:ActionMessage>
  98. </i:EventTrigger>
  99. </i:Interaction.Triggers>-->
  100. </Button>
  101. </StackPanel>
  102. </Grid>
  103. <Grid Grid.Column="1" Margin="10,0,0,0">
  104. <Grid>
  105. <Grid.RowDefinitions>
  106. <RowDefinition Height="Auto"/>
  107. <RowDefinition Height="*"/>
  108. </Grid.RowDefinitions>
  109. <StackPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
  110. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="24">
  111. <TextBlock Text="Total:" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  112. </Border>
  113. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="130" Height="24">
  114. <TextBlock Text="{Binding SearchedResult.Count}" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  115. </Border>
  116. <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="24">
  117. <TextBlock Text="Records" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  118. </Border>-->
  119. <!--<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="150" Height="24">
  120. <TextBlock Text="" FlowDirection="LeftToRight" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  121. </Border>-->
  122. </StackPanel>
  123. <DataGrid Grid.Row="1" Margin="0,5,0,0"
  124. AlternationCount="2"
  125. ScrollViewer.CanContentScroll="True"
  126. ScrollViewer.VerticalScrollBarVisibility="Auto"
  127. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  128. HorizontalAlignment="Left"
  129. AutoGenerateColumns="False" Name="dataGrid1" ItemsSource="{Binding SearchedResult,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
  130. FontFamily="Arial,SimSun"
  131. CanUserReorderColumns="False" CanUserAddRows="False"
  132. CanUserSortColumns="False"
  133. IsReadOnly="True" FontSize="14">
  134. <DataGrid.Columns>
  135. <DataGridTemplateColumn Width="40" CanUserSort="True" SortMemberPath="Icon">
  136. <DataGridTemplateColumn.CellTemplate>
  137. <DataTemplate>
  138. <Image Width="20" Height="20" HorizontalAlignment="Center" Stretch="Fill" VerticalAlignment="Center" Source="{Binding Icon}" />
  139. </DataTemplate>
  140. </DataGridTemplateColumn.CellTemplate>
  141. </DataGridTemplateColumn>
  142. <DataGridTextColumn Width="50" Binding="{Binding ID,Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
  143. <DataGridTextColumn.HeaderTemplate >
  144. <DataTemplate>
  145. <TextBlock Text="ID" VerticalAlignment="Center" TextAlignment="Center"/>
  146. </DataTemplate>
  147. </DataGridTextColumn.HeaderTemplate>
  148. </DataGridTextColumn>
  149. <DataGridTextColumn Width="70" Binding="{Binding LogType,Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
  150. <DataGridTextColumn.HeaderTemplate >
  151. <DataTemplate>
  152. <TextBlock Text="Type" VerticalAlignment="Center" TextAlignment="Center"/>
  153. </DataTemplate>
  154. </DataGridTextColumn.HeaderTemplate>
  155. </DataGridTextColumn>
  156. <DataGridTextColumn Width="170" Binding="{Binding Time,Mode=OneWay}" CanUserSort="True" CanUserReorder="True" IsReadOnly="True" CanUserResize="False">
  157. <DataGridTextColumn.HeaderTemplate >
  158. <DataTemplate>
  159. <TextBlock Text="Time" VerticalAlignment="Center" TextAlignment="Center"/>
  160. </DataTemplate>
  161. </DataGridTextColumn.HeaderTemplate>
  162. </DataGridTextColumn>
  163. <DataGridTextColumn Width="100" Binding="{Binding TargetChamber,Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
  164. <DataGridTextColumn.HeaderTemplate >
  165. <DataTemplate>
  166. <TextBlock Text="System" VerticalAlignment="Center" TextAlignment="Center"/>
  167. </DataTemplate>
  168. </DataGridTextColumn.HeaderTemplate>
  169. </DataGridTextColumn>
  170. <DataGridTextColumn Width="*" Binding="{Binding Detail,Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
  171. <DataGridTextColumn.HeaderTemplate >
  172. <DataTemplate>
  173. <TextBlock Text=" Content" TextWrapping="Wrap" VerticalAlignment="Center" TextAlignment="Center"/>
  174. </DataTemplate>
  175. </DataGridTextColumn.HeaderTemplate>
  176. </DataGridTextColumn>
  177. </DataGrid.Columns>
  178. </DataGrid>
  179. </Grid>
  180. </Grid>
  181. </Grid>
  182. </UserControl>