AlarmShowView.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <UserControl x:Class="NEIntelligentControl2.Views.Alarm.AlarmShowView"
  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:NEIntelligentControl2.Views.Alarm"
  7. mc:Ignorable="d"
  8. d:DesignHeight="581" d:DesignWidth="319" Width="319" MaxHeight="581" Loaded="UserControl_Loaded">
  9. <UserControl.Resources>
  10. <ControlTemplate x:Key="unfixed">
  11. <Viewbox>
  12. <Canvas Width="1024" Height="1024" Background="#01FFFFFF">
  13. <Path Fill="#CC464646" Data="M187.690667 874.709333h-0.277334a37.504 37.504 0 0 1-26.602666-11.264 37.845333 37.845333 0 0 1-3.904-49.877333l166.762666-229.76-125.013333-125.056a38.229333 38.229333 0 0 1-6.058667-46.336 140.8 140.8 0 0 1 53.504-45.674667 154.24 154.24 0 0 1 67.84-15.552 161.792 161.792 0 0 1 51.84 8.533334l6.4 0.661333c5.781333 0.405333 10.901333 0.981333 15.701334 1.749333a161.877333 161.877333 0 0 0 104.277333-47.253333 144.874667 144.874667 0 0 0 58.474667-90.346667c0-5.802667 0-11.904-0.234667-17.664a80.576 80.576 0 0 1 15.658667-74.858666A84.949333 84.949333 0 0 1 626.858667 106.666667a85.525333 85.525333 0 0 1 54.08 19.328l1.962666 1.941333c18.88 18.432 207.253333 206.933333 209.066667 208.746667A85.930667 85.930667 0 0 1 917.333333 397.888a85.973333 85.973333 0 0 1-25.6 61.205333 67.456 67.456 0 0 1-46.549333 16.874667 199.210667 199.210667 0 0 1-30.229333-3.008 226.176 226.176 0 0 0-15.701334-0.362667h-1.493333a115.605333 115.605333 0 0 0-77.930667 45.205334 210.752 210.752 0 0 0-59.456 118.976c0.917333 7.850667 2.56 21.333333 2.858667 23.125333a144.298667 144.298667 0 0 1-57.258667 165.056 38.229333 38.229333 0 0 1-20.138666 5.717333 38.058667 38.058667 0 0 1-27.093334-11.2l-123.562666-123.733333L209.92 866.986667a36.266667 36.266667 0 0 1-22.229333 7.722666z"/>
  14. </Canvas>
  15. </Viewbox>
  16. </ControlTemplate>
  17. <ControlTemplate x:Key="fixed">
  18. <Viewbox>
  19. <Canvas Width="1024" Height="1024" Background="#01FFFFFF">
  20. <Path Fill="#CC464646" Data="m559.42 1006.7-0.19651 0.1957a37.504 37.504 45 0 1-26.798 10.792 37.845 37.845 0 0 1-37.963-32.585l-43.975-280.47-176.83-0.3904a38.229 38.229 0 0 1-36.991-28.556 140.8 140.8 0 0 1 5.679-70.118 154.24 154.24 0 0 1 37.093-58.892 161.79 161.79 0 0 1 42.753-30.535l5.0014-4.0477c4.3824-3.7925 8.4166-6.9974 12.36-9.8404a161.88 161.88 0 0 0 40.54-107.07 144.87 144.87 0 0 0-22.322-105.28c-4.0947-4.1115-8.4002-8.4345-12.631-12.35a80.576 80.576 0 0 1-41.73-64.091 84.949 84.949 0 0 1 25.195-60.862 85.525 85.525 0 0 1 51.957-24.468l2.7606-9e-3c26.384-0.26304 292.87 0.37037 295.44 0.37559a85.931 85.931 0 0 1 61.163 25.467 85.973 85.973 0 0 1 25.052 61.432 67.456 67.456 0 0 1-21.074 44.805 199.21 199.21 0 0 1-23.542 19.2 226.18 226.18 0 0 0-11.381 10.823l-1.0581 1.0538a115.61 115.61 0 0 0-23.318 87.023 210.75 210.75 0 0 0 41.83 126.26c6.1899 4.9152 16.868 13.309 18.344 14.368a144.3 144.3 45 0 1 75.904 157.36 38.229 38.229 0 0 1-10.235 18.262 38.059 38.059 0 0 1-27.1 11.183l-174.86-0.47738-38.766 280.29a36.267 36.267 0 0 1-10.301 21.158z"/>
  21. </Canvas>
  22. </Viewbox>
  23. </ControlTemplate>
  24. <ControlTemplate x:Key="map">
  25. <Viewbox>
  26. <Canvas Width="1024" Height="1024" Background="#01FFFFFF">
  27. <Path Fill="WhiteSmoke" Data="M129.28 911.36a40.94976 40.94976 0 0 1-40.96-40.96V256a40.96512 40.96512 0 0 1 25.74848-38.03136l256-102.4A40.96 40.96 0 0 1 426.24 153.6v614.4a40.96512 40.96512 0 0 1-25.74848 38.03136l-256 102.4a40.86784 40.86784 0 0 1-15.21152 2.92864z m40.96-627.63008v526.17216l174.08-69.632V214.09792l-174.08 69.632z"/>
  28. <Path Fill="WhiteSmoke" Data="M638.71488 911.36a40.8576 40.8576 0 0 1-15.2064-2.92864l-256-102.4A40.96 40.96 0 0 1 341.76 768V153.6a40.97024 40.97024 0 0 1 56.17152-38.03136l256 102.4A40.96 40.96 0 0 1 679.68 256v614.4a40.96 40.96 0 0 1-40.96512 40.96zM423.68 740.27008l174.08 69.632V283.72992l-174.08-69.632v526.17216z"/>
  29. <Path Fill="WhiteSmoke" Data="M638.72512 911.36a40.97024 40.97024 0 0 1-40.96512-40.96V256a40.96 40.96 0 0 1 25.74848-38.03136l256-102.4A40.97024 40.97024 0 0 1 935.68 153.6v614.4a40.96 40.96 0 0 1-25.74848 38.03136l-256 102.4a40.8576 40.8576 0 0 1-15.2064 2.92864z m40.95488-627.63008v526.17216l174.08-69.632V214.09792l-174.08 69.632z"/>
  30. </Canvas>
  31. </Viewbox>
  32. </ControlTemplate>
  33. <ControlTemplate x:Key="ok">
  34. <Viewbox>
  35. <Canvas Width="1024" Height="1024" Background="#01FFFFFF">
  36. <Path Fill="WhiteSmoke" Data="M1001.216 128a2407.936 2407.936 0 0 0-559.104 480.384L224.384 438.912 128 515.84 503.808 896A2291.456 2291.456 0 0 1 1024 181.248l-22.784-52.992"/>
  37. </Canvas>
  38. </Viewbox>
  39. </ControlTemplate>
  40. <!--铃铛-->
  41. <ControlTemplate x:Key="bell">
  42. <Viewbox>
  43. <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="bell" Width="829.333" Height="922.667" Clip="F1 M 0,0L 829.333,0L 829.333,922.667L 0,922.667L 0,0">
  44. <Canvas x:Name="bell_0" Width="829.333" Height="922.667" Canvas.Left="0" Canvas.Top="0">
  45. <Path x:Name="Path" Width="818.366" Height="910.282" Canvas.Left="5.79712" Canvas.Top="8.43347" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 802.735,609.532L 720.813,527.157L 720.813,324.177C 723.068,168.319 610.016,34.6774 455.937,11.0627C 368.459,-0.462646 280.251,26.2507 213.855,84.3707C 147.459,142.485 109.308,226.381 109.147,314.62L 109.147,527.157L 27.224,609.532C 6.18803,630.917 2.98818e-005,662.824 11.5214,690.527C 23.0374,718.224 50.0214,736.339 80.016,736.505L 232.937,736.505L 232.937,751.98C 237.36,848.177 318.771,922.667 414.98,918.553C 511.188,922.667 592.6,848.177 597.027,751.98L 597.027,736.505L 749.943,736.505C 779.943,736.339 806.923,718.224 818.443,690.527C 829.959,662.824 823.771,630.917 802.735,609.532 Z M 506,751.98C 500.761,797.459 460.647,830.756 414.98,827.532C 369.313,830.756 329.204,797.459 323.959,751.98L 323.959,736.505L 506,736.505"/>
  46. </Canvas>
  47. </Canvas>
  48. </Viewbox>
  49. </ControlTemplate>
  50. <Style x:Key="ButtonStyleMain" TargetType="{x:Type Button}">
  51. <Setter Property="Template">
  52. <Setter.Value>
  53. <ControlTemplate TargetType="{x:Type Button}">
  54. <Border x:Name="bd" CornerRadius="3" Background="#FFDB5447">
  55. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  56. </Border>
  57. <ControlTemplate.Triggers>
  58. <Trigger Property="IsMouseOver" Value="True">
  59. <Setter TargetName="bd" Property="Background" Value="#FFEC6254"/>
  60. </Trigger>
  61. <Trigger Property="IsMouseCaptured" Value="True">
  62. <Setter TargetName="bd" Property="Background" Value="#FFDB5447"/>
  63. </Trigger>
  64. </ControlTemplate.Triggers>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. <Style TargetType="{x:Type ScrollBar}">
  70. <Setter Property="Background" Value="#77F0F8FF"/>
  71. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  72. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  73. <!--滚动条宽度-->
  74. <Setter Property="Width" Value="8"/>
  75. <Setter Property="MinWidth" Value="6"/>
  76. <Setter Property="Template">
  77. <Setter.Value>
  78. <ControlTemplate TargetType="{x:Type ScrollBar}">
  79. <!--滚动条背景色-->
  80. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  81. <Grid.RowDefinitions>
  82. <RowDefinition />
  83. </Grid.RowDefinitions>
  84. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  85. <Track.DecreaseRepeatButton>
  86. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  87. </Track.DecreaseRepeatButton>
  88. <Track.IncreaseRepeatButton>
  89. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  90. </Track.IncreaseRepeatButton>
  91. <Track.Thumb>
  92. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  93. </Track.Thumb>
  94. </Track>
  95. </Grid>
  96. <ControlTemplate.Triggers>
  97. <Trigger Property="IsEnabled" Value="false">
  98. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  99. </Trigger>
  100. </ControlTemplate.Triggers>
  101. </ControlTemplate>
  102. </Setter.Value>
  103. </Setter>
  104. <Style.Triggers>
  105. <Trigger Property="Orientation" Value="Horizontal">
  106. <Setter Property="Width" Value="Auto"/>
  107. <Setter Property="MinWidth" Value="0"/>
  108. <Setter Property="Height" Value="6"/>
  109. <Setter Property="MinHeight" Value="6"/>
  110. <Setter Property="Background" Value="#77F0F8FF"/>
  111. <Setter Property="Template">
  112. <Setter.Value>
  113. <ControlTemplate TargetType="{x:Type ScrollBar}">
  114. <Grid x:Name="Bg" Background="Red" SnapsToDevicePixels="true">
  115. <Grid.ColumnDefinitions>
  116. <ColumnDefinition />
  117. </Grid.ColumnDefinitions>
  118. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  119. <Track.DecreaseRepeatButton>
  120. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  121. </Track.DecreaseRepeatButton>
  122. <Track.IncreaseRepeatButton>
  123. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  124. </Track.IncreaseRepeatButton>
  125. <Track.Thumb>
  126. <Thumb Style="{StaticResource ScrollBarThumb}" />
  127. </Track.Thumb>
  128. </Track>
  129. </Grid>
  130. <ControlTemplate.Triggers>
  131. <Trigger Property="IsEnabled" Value="false">
  132. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  133. </Trigger>
  134. </ControlTemplate.Triggers>
  135. </ControlTemplate>
  136. </Setter.Value>
  137. </Setter>
  138. </Trigger>
  139. </Style.Triggers>
  140. </Style>
  141. <DataTemplate x:Key="ListViewItemTemplate">
  142. <Grid x:Name="gbcenter" Background="#FFFE7A6F" Margin="0,2" Width="298" MinHeight="120">
  143. <Grid.RowDefinitions>
  144. <RowDefinition Height="Auto"/>
  145. <RowDefinition/>
  146. <RowDefinition Height="Auto"/>
  147. </Grid.RowDefinitions>
  148. <Grid x:Name="gbtitle" Background="#FFE56155">
  149. <Grid.ColumnDefinitions>
  150. <ColumnDefinition Width="Auto"/>
  151. <ColumnDefinition/>
  152. </Grid.ColumnDefinitions>
  153. <ContentControl Template="{StaticResource bell}" HorizontalAlignment="Left" Width="19" Margin="3"/>
  154. <TextBlock x:Name="tbtitle" Grid.Column="1" Text="{Binding Title}" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="White" FontSize="14"/>
  155. <TextBlock x:Name="tbtime" Grid.Column="1" Text="{Binding Time}" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="White" Margin="2,0"/>
  156. </Grid>
  157. <TextBlock Grid.Row="1" x:Name="tbmsg" Text="{Binding Message}" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14" TextWrapping="Wrap"/>
  158. <Grid Grid.Row="2" Margin="2">
  159. <Button HorizontalAlignment="Left" Style="{DynamicResource ButtonStyleMain}" Tag="{Binding}" Click="Button_Click">
  160. <StackPanel Orientation="Horizontal" Margin="7,2">
  161. <ContentControl Width="24" Height="24" Template="{StaticResource map}" Margin="0,0,5,0"/>
  162. <TextBlock Text="生成缺陷单" FontSize="14" VerticalAlignment="Center" Foreground="WhiteSmoke"/>
  163. </StackPanel>
  164. </Button>
  165. <Button HorizontalAlignment="Right" Style="{DynamicResource ButtonStyleMain}" Tag="{Binding}" Click="Button_Click">
  166. <StackPanel Orientation="Horizontal" Margin="7,2">
  167. <ContentControl Width="24" Height="24" Template="{StaticResource ok}" Margin="0,0,5,0"/>
  168. <TextBlock Text="确认" FontSize="14" VerticalAlignment="Center" Foreground="WhiteSmoke"/>
  169. </StackPanel>
  170. </Button>
  171. </Grid>
  172. </Grid>
  173. <DataTemplate.Triggers>
  174. <DataTrigger Binding="{Binding IsOpened}" Value="False">
  175. <Setter TargetName="gbtitle" Property="Background" Value="#FFFF958C"/>
  176. <Setter TargetName="gbcenter" Property="Background" Value="#FFFFC0BB"/>
  177. <Setter TargetName="tbtitle" Property="Foreground" Value="Black"/>
  178. <Setter TargetName="tbtime" Property="Foreground" Value="Black"/>
  179. <Setter TargetName="tbmsg" Property="Foreground" Value="Black"/>
  180. </DataTrigger>
  181. </DataTemplate.Triggers>
  182. </DataTemplate>
  183. <Style x:Key="ListBoxItemContainerStyle" TargetType="{x:Type ListBoxItem}">
  184. <Setter Property="SnapsToDevicePixels" Value="True"/>
  185. <Setter Property="Padding" Value="4,1"/>
  186. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  187. <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  188. <Setter Property="Background" Value="Transparent"/>
  189. <Setter Property="BorderBrush" Value="Transparent"/>
  190. <Setter Property="BorderThickness" Value="1"/>
  191. <Setter Property="Template">
  192. <Setter.Value>
  193. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  194. <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
  195. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  196. </Border>
  197. </ControlTemplate>
  198. </Setter.Value>
  199. </Setter>
  200. </Style>
  201. </UserControl.Resources>
  202. <UserControl.ContentTemplate>
  203. <DataTemplate>
  204. <Grid x:Name="_GDMain">
  205. <Grid x:Name="gdmain" Background="#FFA0A0A0" MinHeight="370">
  206. <ListBox x:Name="_LBMain" ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle}" ItemTemplate="{DynamicResource ListViewItemTemplate}" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=Alarms}" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0" Margin="0,25,0,0"/>
  207. </Grid>
  208. <ContentControl x:Name="cc" HorizontalAlignment="Right" VerticalAlignment="Top" MouseLeftButtonUp="cc_MouseLeftButtonUp" Width="25" Height="25" ToolTip="打开报警"/>
  209. </Grid>
  210. <DataTemplate.Triggers>
  211. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsFixed}" Value="True">
  212. <Setter TargetName="cc" Property="Template" Value="{DynamicResource fixed}"/>
  213. <Setter TargetName="gdmain" Property="Visibility" Value="Visible"/>
  214. </DataTrigger>
  215. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsFixed}" Value="False">
  216. <Setter TargetName="cc" Property="Template" Value="{DynamicResource unfixed}"/>
  217. <Setter TargetName="gdmain" Property="Visibility" Value="Hidden"/>
  218. </DataTrigger>
  219. </DataTemplate.Triggers>
  220. </DataTemplate>
  221. </UserControl.ContentTemplate>
  222. </UserControl>