ModuleAlarmView.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Alarms.ModuleAlarm.ModuleAlarmView"
  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:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  7. xmlns:alarm="clr-namespace:MECF.Framework.UI.Client.CenterViews.Alarms.Alarm"
  8. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  9. xmlns:micro="clr-namespace:Caliburn.Micro"
  10. xmlns:moduleAlarm="clr-namespace:MECF.Framework.UI.Client.CenterViews.Alarms.ModuleAlarm"
  11. mc:Ignorable="d"
  12. d:DesignHeight="625" d:DesignWidth="1200">
  13. <UserControl.Resources>
  14. <moduleAlarm:TypeColorConverter x:Key="TypeColorConverter"/>
  15. <Style x:Key="localListBoxItem" TargetType="{x:Type xctk:SelectorItem}">
  16. <Setter Property="Background" Value="Transparent"/>
  17. <Setter Property="Margin" Value="0,0,20,0"/>
  18. <Setter Property="Padding" Value="0"/>
  19. <Setter Property="BorderThickness" Value="0"/>
  20. </Style>
  21. </UserControl.Resources>
  22. <Grid>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="40"/>
  25. <RowDefinition Height="*"/>
  26. </Grid.RowDefinitions>
  27. <StackPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Horizontal">
  28. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1" Width="70" Height="40">
  29. <TextBlock Text="Modules:" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  30. </Border>
  31. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="60" Height="40">
  32. <CheckBox Content="All" IsChecked="{Binding IsAllSelected,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  33. HorizontalContentAlignment="Stretch"
  34. VerticalContentAlignment="Center"
  35. FontSize="14"
  36. Command="{Binding SelectAllChanged}"
  37. VerticalAlignment="Center">
  38. </CheckBox>
  39. </Border>
  40. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Width="800" Height="40">
  41. <xctk:CheckListBox ItemsSource="{Binding AllModules}"
  42. DisplayMemberPath="ModuleName"
  43. SelectedMemberPath="IsSelected"
  44. HorizontalContentAlignment="Stretch"
  45. VerticalContentAlignment="Center"
  46. BorderThickness="0"
  47. FontSize="14"
  48. Command="{Binding SelectionChanged}"
  49. ItemContainerStyle="{DynamicResource localListBoxItem}"
  50. VerticalAlignment="Center"
  51. SelectedItemsOverride="{Binding SelectedModules,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  52. <xctk:CheckListBox.ItemsPanel>
  53. <ItemsPanelTemplate>
  54. <WrapPanel IsItemsHost="True" Orientation="Horizontal" Margin="1,1,0,0"/>
  55. </ItemsPanelTemplate>
  56. </xctk:CheckListBox.ItemsPanel>
  57. </xctk:CheckListBox>
  58. </Border>
  59. </StackPanel>
  60. <DataGrid Grid.Row="1" Margin="0,5,0,0"
  61. Width="Auto"
  62. ScrollViewer.CanContentScroll="True"
  63. ScrollViewer.VerticalScrollBarVisibility="Auto"
  64. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  65. HorizontalAlignment="Left"
  66. AutoGenerateColumns="False" ItemsSource="{Binding FilteredAlarms}"
  67. CanUserReorderColumns="False" CanUserAddRows="False"
  68. CanUserSortColumns="False"
  69. IsReadOnly="True" FontSize="14">
  70. <DataGrid.Columns>
  71. <DataGridTemplateColumn Header="Type" Width="90" CanUserSort="True" SortMemberPath="Type">
  72. <DataGridTemplateColumn.HeaderTemplate >
  73. <DataTemplate>
  74. <TextBlock Text="Type" />
  75. </DataTemplate>
  76. </DataGridTemplateColumn.HeaderTemplate>
  77. <DataGridTemplateColumn.CellTemplate>
  78. <DataTemplate>
  79. <Label Content="{Binding Type}" Background="{Binding Type, Converter={StaticResource TypeColorConverter}}" FontSize="12"/>
  80. </DataTemplate>
  81. </DataGridTemplateColumn.CellTemplate>
  82. </DataGridTemplateColumn>
  83. <DataGridTextColumn Header="Time" Width="150" CanUserSort="True" IsReadOnly="True" Binding="{Binding OccuringTime,Mode=OneWay}">
  84. <DataGridTextColumn.HeaderTemplate >
  85. <DataTemplate>
  86. <TextBlock Text="Time" />
  87. </DataTemplate>
  88. </DataGridTextColumn.HeaderTemplate>
  89. </DataGridTextColumn>
  90. <DataGridTextColumn Header="Source" Width="150" CanUserSort="True" IsReadOnly="True" Binding="{Binding Source,Mode=OneWay}">
  91. <DataGridTextColumn.HeaderTemplate >
  92. <DataTemplate>
  93. <TextBlock Text="Source" />
  94. </DataTemplate>
  95. </DataGridTextColumn.HeaderTemplate>
  96. </DataGridTextColumn>
  97. <DataGridTemplateColumn Header="Description" Width="*" CanUserSort="True" SortMemberPath="Description">
  98. <DataGridTemplateColumn.HeaderTemplate >
  99. <DataTemplate>
  100. <TextBlock Text="Description" />
  101. </DataTemplate>
  102. </DataGridTemplateColumn.HeaderTemplate>
  103. <DataGridTemplateColumn.CellTemplate>
  104. <DataTemplate>
  105. <TextBlock Text="{Binding Description}" TextWrapping="Wrap" FontSize="12"/>
  106. </DataTemplate>
  107. </DataGridTemplateColumn.CellTemplate>
  108. </DataGridTemplateColumn>
  109. <DataGridTemplateColumn Width="110">
  110. <DataGridTemplateColumn.CellTemplate>
  111. <DataTemplate>
  112. <Button Content="Reset" Width="100" Height="25" FontSize="14">
  113. <i:Interaction.Triggers>
  114. <i:EventTrigger EventName="Click">
  115. <micro:ActionMessage MethodName="ResetAlarm">
  116. <micro:Parameter Value="{Binding }" />
  117. </micro:ActionMessage>
  118. </i:EventTrigger>
  119. </i:Interaction.Triggers>
  120. </Button>
  121. </DataTemplate>
  122. </DataGridTemplateColumn.CellTemplate>
  123. </DataGridTemplateColumn>
  124. </DataGrid.Columns>
  125. </DataGrid>
  126. </Grid>
  127. <!--<GroupBox Header="Alarm List" Margin="5,0,12,5">
  128. <DataGrid Grid.Row="1" Margin="0,5,0,0"
  129. Width="Auto"
  130. ScrollViewer.CanContentScroll="True"
  131. ScrollViewer.VerticalScrollBarVisibility="Auto"
  132. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  133. HorizontalAlignment="Left"
  134. AutoGenerateColumns="False" Name="dataGrid1" ItemsSource="{Binding AlarmEvents,Mode=OneWay}"
  135. FontFamily="Arial,SimSun"
  136. CanUserReorderColumns="False" CanUserAddRows="False"
  137. CanUserSortColumns="False"
  138. IsReadOnly="True" FontSize="14">
  139. <DataGrid.Columns>
  140. <DataGridTemplateColumn Header="Type" Width="90" CanUserSort="True" SortMemberPath="Type">
  141. <DataGridTemplateColumn.HeaderTemplate >
  142. <DataTemplate>
  143. <TextBlock Text="Type" />
  144. </DataTemplate>
  145. </DataGridTemplateColumn.HeaderTemplate>
  146. <DataGridTemplateColumn.CellTemplate>
  147. <DataTemplate>
  148. <Label Content="{Binding Type}" Background="{Binding TextColor}" FontSize="12"/>
  149. </DataTemplate>
  150. </DataGridTemplateColumn.CellTemplate>
  151. </DataGridTemplateColumn>
  152. <DataGridTextColumn Header="Time" Width="150" CanUserSort="True" IsReadOnly="True" Binding="{Binding OccuringTime,Mode=OneWay}">
  153. <DataGridTextColumn.HeaderTemplate >
  154. <DataTemplate>
  155. <TextBlock Text="Time" />
  156. </DataTemplate>
  157. </DataGridTextColumn.HeaderTemplate>
  158. </DataGridTextColumn>
  159. <DataGridTextColumn Header="Description" Width="*" CanUserSort="True" IsReadOnly="True" Binding="{Binding Description,Mode=OneWay}">
  160. <DataGridTextColumn.HeaderTemplate >
  161. <DataTemplate>
  162. <TextBlock Text="Description" />
  163. </DataTemplate>
  164. </DataGridTextColumn.HeaderTemplate>
  165. </DataGridTextColumn>
  166. </DataGrid.Columns>
  167. </DataGrid>
  168. </GroupBox>-->
  169. <!--<GroupBox Grid.Column="1" Header="Detail" Margin="0,0,5,5">
  170. <TextBlock x:Name="AnalysisText" FontSize="14" Margin="5" Background="White" TextWrapping="Wrap" Style="{x:Null}"/>
  171. </GroupBox>-->
  172. </UserControl>