WarningPopUp.xaml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <UserControl x:Class="HistoryView.Controls.WarningPopUp"
  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:HistoryView.Controls"
  7. xmlns:converters="clr-namespace:HistoryView.Converters"
  8. xmlns:resource="clr-namespace:HistoryView.Resources"
  9. mc:Ignorable="d"
  10. x:Name="This"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.Resources>
  13. <converters:DateTimeToString x:Key="DatetimeConverter"/>
  14. <converters:IAlarmLastConverter x:Key="IAlarmLastConverter"/>
  15. </UserControl.Resources>
  16. <Grid>
  17. <Border x:Name="PopPos" CornerRadius="4" Background="Transparent">
  18. <StackPanel Orientation="Horizontal">
  19. <Image Source="{StaticResource Icon_Bell}" Height="22"/>
  20. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{StaticResource TextColor}" MaxWidth="72" TextWrapping="Wrap" Margin="8,0" Text="{DynamicResource Alarm}"/>
  21. <Border x:Name="WarningHint" VerticalAlignment="Center" Background="{StaticResource EmergencyColor}" CornerRadius="2">
  22. <TextBlock Margin="4,0" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{StaticResource TextColor}" Text="{Binding ElementName=This, Path=Counter}"/>
  23. </Border>
  24. </StackPanel>
  25. </Border>
  26. <Popup Width="300" Height="auto" PopupAnimation="Slide" StaysOpen="True" IsOpen="{Binding ElementName=This, Path=IsOpen}" AllowsTransparency="True" Placement="Bottom" PlacementTarget="{Binding ElementName=PopPos}" VerticalOffset="12">
  27. <Border CornerRadius="4" Height="400" BorderThickness="2" BorderBrush="Black" Background="AliceBlue">
  28. <Grid Margin="8">
  29. <Grid.RowDefinitions>
  30. <RowDefinition Height="auto"/>
  31. <RowDefinition Height="8"/>
  32. <RowDefinition/>
  33. <RowDefinition Height="8"/>
  34. <RowDefinition Height="auto"/>
  35. </Grid.RowDefinitions>
  36. <TextBlock FontSize="14" FontWeight="Bold" >警报信息</TextBlock>
  37. <resource:TouchableScrollViewer Grid.Row="2" VerticalScrollBarVisibility="Hidden">
  38. <ItemsControl ItemsSource="{Binding ElementName=This, Path=AlarmSource}">
  39. <ItemsControl.ItemTemplate>
  40. <DataTemplate>
  41. <Border Margin="2,6">
  42. <Grid>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition Width="auto"/>
  45. <ColumnDefinition Width="12"/>
  46. <ColumnDefinition Width="auto"/>
  47. <ColumnDefinition Width="12"/>
  48. <ColumnDefinition Width="auto"/>
  49. <ColumnDefinition Width="12"/>
  50. <ColumnDefinition Width="auto"/>
  51. </Grid.ColumnDefinitions>
  52. <Grid.RowDefinitions>
  53. <RowDefinition Height="auto"/>
  54. <RowDefinition Height="2"/>
  55. <RowDefinition Height="auto"/>
  56. </Grid.RowDefinitions>
  57. <Image Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Source="{StaticResource Icon_Warning}" Height="22" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  58. <TextBlock Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Value, Converter={StaticResource IAlarmLastConverter}, ConverterParameter=Date}"/>
  59. <TextBlock Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Value, Converter={StaticResource IAlarmLastConverter}, ConverterParameter=Time}"/>
  60. <TextBlock Grid.Column="4" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Value, Converter={StaticResource IAlarmLastConverter}, ConverterParameter=AlarmMini8}"/>
  61. <TextBlock Grid.Column="6" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Value, Converter={StaticResource IAlarmLastConverter}, ConverterParameter=AlarmChannel}"/>
  62. <TextBlock Grid.Column="4" Grid.Row="2" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Value, Converter={StaticResource IAlarmLastConverter}, ConverterParameter=AlarmDetail}"/>
  63. </Grid>
  64. </Border>
  65. </DataTemplate>
  66. </ItemsControl.ItemTemplate>
  67. <ItemsControl.ItemsPanel>
  68. <ItemsPanelTemplate>
  69. <StackPanel VerticalAlignment="Top"/>
  70. </ItemsPanelTemplate>
  71. </ItemsControl.ItemsPanel>
  72. </ItemsControl>
  73. </resource:TouchableScrollViewer>
  74. <Button Grid.Row="4" Style="{StaticResource FunctionButton}" Click="Button_Click">关闭</Button>
  75. </Grid>
  76. </Border>
  77. </Popup>
  78. </Grid>
  79. </UserControl>