RealTimeAlarmWindow.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <Window x:Class="NEIntelligentControl2.Windows.Alarm.RealTimeAlarmWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:NEIntelligentControl2.Windows"
  7. xmlns:alarm="clr-namespace:NEIntelligentControl2.Views.Alarm"
  8. xmlns:ib="clr-namespace:NEIntelligentControl2.Views.Basic"
  9. mc:Ignorable="d"
  10. Title="实时报警" Height="662" Width="1200" Background="#FFE3E3E3" WindowStyle="None" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
  11. <WindowChrome.WindowChrome>
  12. <WindowChrome/>
  13. </WindowChrome.WindowChrome>
  14. <Window.Resources>
  15. <ResourceDictionary>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="/Res/Alarm.xaml"/>
  18. </ResourceDictionary.MergedDictionaries>
  19. <Style x:Key="TagStackPanelStyle" TargetType="StackPanel">
  20. <Setter Property="Orientation" Value="Horizontal"/>
  21. <Setter Property="Margin" Value="10"/>
  22. </Style>
  23. <Style x:Key="TagTextBlockStyle" TargetType="TextBlock">
  24. <Setter Property="VerticalAlignment" Value="Center"/>
  25. </Style>
  26. <Style x:Key="TagComboBoxStyle" TargetType="ComboBox">
  27. <Setter Property="MinWidth" Value="100"/>
  28. </Style>
  29. <Style x:Key="TagTextBoxStyle" TargetType="TextBox">
  30. <Setter Property="MinWidth" Value="120"/>
  31. </Style>
  32. <Style TargetType="{x:Type ScrollBar}">
  33. <Setter Property="Background" Value="#77F0F8FF"/>
  34. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  35. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  36. <!--滚动条宽度-->
  37. <Setter Property="Width" Value="8"/>
  38. <Setter Property="MinWidth" Value="6"/>
  39. <Setter Property="Template">
  40. <Setter.Value>
  41. <ControlTemplate TargetType="{x:Type ScrollBar}">
  42. <!--滚动条背景色-->
  43. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  44. <Grid.RowDefinitions>
  45. <RowDefinition />
  46. </Grid.RowDefinitions>
  47. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  48. <Track.DecreaseRepeatButton>
  49. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  50. </Track.DecreaseRepeatButton>
  51. <Track.IncreaseRepeatButton>
  52. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  53. </Track.IncreaseRepeatButton>
  54. <Track.Thumb>
  55. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  56. </Track.Thumb>
  57. </Track>
  58. </Grid>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="IsEnabled" Value="false">
  61. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  62. </Trigger>
  63. </ControlTemplate.Triggers>
  64. </ControlTemplate>
  65. </Setter.Value>
  66. </Setter>
  67. <Style.Triggers>
  68. <Trigger Property="Orientation" Value="Horizontal">
  69. <Setter Property="Width" Value="Auto"/>
  70. <Setter Property="MinWidth" Value="0"/>
  71. <Setter Property="Height" Value="6"/>
  72. <Setter Property="MinHeight" Value="6"/>
  73. <Setter Property="Background" Value="#77F0F8FF"/>
  74. <Setter Property="Template">
  75. <Setter.Value>
  76. <ControlTemplate TargetType="{x:Type ScrollBar}">
  77. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true">
  78. <Grid.ColumnDefinitions>
  79. <ColumnDefinition />
  80. </Grid.ColumnDefinitions>
  81. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  82. <Track.DecreaseRepeatButton>
  83. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  84. </Track.DecreaseRepeatButton>
  85. <Track.IncreaseRepeatButton>
  86. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  87. </Track.IncreaseRepeatButton>
  88. <Track.Thumb>
  89. <Thumb Style="{StaticResource ScrollBarThumb}" />
  90. </Track.Thumb>
  91. </Track>
  92. </Grid>
  93. <ControlTemplate.Triggers>
  94. <Trigger Property="IsEnabled" Value="false">
  95. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  96. </Trigger>
  97. </ControlTemplate.Triggers>
  98. </ControlTemplate>
  99. </Setter.Value>
  100. </Setter>
  101. </Trigger>
  102. </Style.Triggers>
  103. </Style>
  104. </ResourceDictionary>
  105. </Window.Resources>
  106. <Grid Margin="5">
  107. <Grid.RowDefinitions>
  108. <RowDefinition Height="Auto"/>
  109. <RowDefinition Height="Auto"/>
  110. <RowDefinition/>
  111. <RowDefinition Height="Auto"/>
  112. </Grid.RowDefinitions>
  113. <Border Background="#FF3A4E66" CornerRadius="9,0,0,0">
  114. <Grid Margin="0,10">
  115. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
  116. <ContentControl Template="{StaticResource title_icon}" Width="24" Height="24" Margin="5,5,0,5"/>
  117. <TextBlock x:Name="_TBTitle" Text="实时报警查询" FontSize="16" Foreground="WhiteSmoke" Margin="5"/>
  118. </StackPanel>
  119. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
  120. <ContentControl Width="24" Height="24" Margin="5" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" Tag="maximized" ToolTip="最大最小化" WindowChrome.IsHitTestVisibleInChrome="True">
  121. <ContentControl.Style>
  122. <Style TargetType="ContentControl">
  123. <Style.Triggers>
  124. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=WindowState}" Value="Maximized">
  125. <Setter Property="Template" Value="{StaticResource unmaximize}"/>
  126. </DataTrigger>
  127. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=WindowState}" Value="Normal">
  128. <Setter Property="Template" Value="{StaticResource maximize}"/>
  129. </DataTrigger>
  130. </Style.Triggers>
  131. </Style>
  132. </ContentControl.Style>
  133. </ContentControl>
  134. <ContentControl Width="24" Height="24" Template="{StaticResource close}" Background="WhiteSmoke" Margin="5" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" Tag="close" ToolTip="关闭" WindowChrome.IsHitTestVisibleInChrome="True"/>
  135. </StackPanel>
  136. </Grid>
  137. </Border>
  138. <WrapPanel Grid.Row="1" Background="#FFDDE6EF">
  139. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  140. <TextBlock Text="场站:" Style="{StaticResource TagTextBlockStyle}"/>
  141. <ComboBox x:Name="_CBStation" DisplayMemberPath="FullName" Style="{StaticResource TagComboBoxStyle}" SelectionChanged="_CBStation_SelectionChanged" SelectedIndex="0"/>
  142. </StackPanel>
  143. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  144. <TextBlock Text="级别:" Style="{StaticResource TagTextBlockStyle}"/>
  145. <ComboBox x:Name="_CBClass" DisplayMemberPath="Name" Style="{StaticResource TagComboBoxStyle}" SelectedIndex="0" SelectionChanged="_CBClass_SelectionChanged"/>
  146. </StackPanel>
  147. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  148. <TextBlock Text="类型:" Style="{StaticResource TagTextBlockStyle}"/>
  149. <ComboBox x:Name="_CBType" DisplayMemberPath="Name" Style="{StaticResource TagComboBoxStyle}" SelectedIndex="0" SelectionChanged="_CBType_SelectionChanged"/>
  150. </StackPanel>
  151. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  152. <TextBlock Text="子类型:" Style="{StaticResource TagTextBlockStyle}"/>
  153. <ComboBox x:Name="_CBSType" Style="{StaticResource TagComboBoxStyle}" DisplayMemberPath="Name" SelectionChanged="_CBSType_SelectionChanged"/>
  154. </StackPanel>
  155. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  156. <TextBlock Text="风机:" Style="{StaticResource TagTextBlockStyle}"/>
  157. <ComboBox x:Name="_CBWindturbine" Style="{StaticResource TagComboBoxStyle}" SelectionChanged="_CBWindturbine_SelectionChanged"/>
  158. </StackPanel>
  159. <StackPanel Style="{StaticResource TagStackPanelStyle}">
  160. <TextBlock Text="关键字:" Style="{StaticResource TagTextBlockStyle}"/>
  161. <TextBox x:Name="_CBKeyString" Style="{StaticResource TagTextBoxStyle}" LostFocus="_CBKeyString_LostFocus"/>
  162. </StackPanel>
  163. <Button Content="开始查询" VerticalAlignment="Center" Margin="10" Padding="12,3" Click="Button_Click" Tag="search" Style="{StaticResource ConfirmButtonStyle}"/>
  164. </WrapPanel>
  165. <DataGrid x:Name="_DGMain" FontSize="14" ColumnWidth="*" Grid.Row="2" Background="#FFABABAB" IsReadOnly="True" AutoGenerateColumns="False" HorizontalGridLinesBrush="#FF9E9E9E" VerticalGridLinesBrush="#FF9E9E9E">
  166. <DataGrid.Columns>
  167. <DataGridTextColumn Header="时间" Binding="{Binding LatestUpdateTimeString}" Width="150"/>
  168. <DataGridTextColumn Header="设备" Binding="{Binding ObjectName}"/>
  169. <DataGridTextColumn Header="报警信息" Binding="{Binding AlertText}" MinWidth="300"/>
  170. <DataGridTextColumn Header="级别" Binding="{Binding RankString}"/>
  171. <DataGridTextColumn Header="报警类型" Binding="{Binding Category1String}"/>
  172. <DataGridTextColumn Header="停机类型"/>
  173. <DataGridTextColumn Header="故障类型"/>
  174. <DataGridTextColumn Header="故障原因"/>
  175. </DataGrid.Columns>
  176. </DataGrid>
  177. <ib:InfoBar x:Name="_IBMain" Grid.Row="3" IsPagination="False"/>
  178. </Grid>
  179. </Window>