|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- <UserControl
- x:Class="BPASmartClient.CustomResource.Pages.View.AlarmView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.Pages.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.CustomResource.Pages.ViewModel"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:AlarmViewModel />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary>
- <!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
- <convert:IsEnableConvert x:Key="isEnableConvert" />
- <convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
- <convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
- <convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
- <SolidColorBrush x:Key="BorderSolid" Color="#332AB2E7" />
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TitleFontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
- <SolidColorBrush x:Key="TitleBorderColor" Color="#332AB2E7" />
-
- <Style x:Key="TextBlockStyle" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="TextBoxStyle" TargetType="TextBox">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="22" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="BorderBrush" Value="#FF23CACA" />
- <Setter Property="CaretBrush" Value="Aqua" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="DataTextBlockStyle" TargetType="TextBlock">
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="#FFF53F62" />
- <Setter Property="FontSize" Value="14" />
- </Style>
-
- <ControlTemplate x:Key="ButTemplate" TargetType="Button">
- <Border
- x:Name="br"
- Background="Transparent"
- BorderBrush="#FF19B7EC"
- BorderThickness="2">
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <ContentControl
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- Foreground="{TemplateBinding Foreground}" />
- </StackPanel>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
- </Trigger>
-
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
- </Trigger>
-
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <StackPanel
- Margin="0,8"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
-
- <DatePicker
- Background="Transparent"
- BorderBrush="#aa3aa7f3"
- BorderThickness="2"
- SelectedDate="{Binding StartDateTime}"
- Style="{StaticResource PickerStyle}"
- Text="请输入开始时间"
- Visibility="{Binding IsVisibility}" />
-
- <DatePicker
- Margin="20,0,20,0"
- Background="Transparent"
- BorderBrush="#aa3aa7f3"
- BorderThickness="2"
- SelectedDate="{Binding EndDateTime}"
- Style="{StaticResource PickerStyle}"
- Text="请输入结束时间"
- Visibility="{Binding IsVisibility}" />
-
- <Button
- Width="140"
- Height="30"
- Background="#FF19B7EC"
- Command="{Binding ControlCommand}"
- Content="{Binding ControlButText}"
- FontFamily="楷体"
- FontSize="18"
- Template="{StaticResource ButTemplate}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#FFBB662A" />
- <GradientStop Offset="1" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
-
- <Button
- Width="140"
- Height="30"
- Margin="20,0,0,0"
- Background="#FF19B7EC"
- Command="{Binding SwitchCommand}"
- Content="{Binding ButContent}"
- FontFamily="楷体"
- FontSize="18"
- Template="{StaticResource ButTemplate}">
- <Button.Foreground>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#FFBB662A" />
- <GradientStop Offset="1" Color="White" />
- </LinearGradientBrush>
- </Button.Foreground>
- </Button>
-
- </StackPanel>
-
- <!--#region 表格标题栏设置-->
- <Grid Grid.Row="1" Background="#ff0C255F">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.5*" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="ID" />
-
- <Grid Grid.Column="1">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="报警日期" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="报警时间" />
-
- <Grid Grid.Column="3">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="报警信息" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="报警值" />
-
- <Grid Grid.Column="5">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="报警等级" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
- </Grid>
- <!--#endregion-->
-
- <!--#region 表格数据显示-->
- <ScrollViewer
- Grid.Row="2"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="139*"/>
- <ColumnDefinition Width="641*"/>
- </Grid.ColumnDefinitions>
- <!--#region 实时报警信息-->
- <ItemsControl ItemsSource="{Binding AlarmInfos}" Visibility="{Binding CurrentDataVis}" Grid.ColumnSpan="2">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid x:Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.5*" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding NumId}" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Time}" />
-
- <Grid Grid.Column="3">
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Info}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Value}" />
-
- <Grid Grid.Column="5">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="6"
- BorderBrush="{StaticResource BorderSolid}"
- BorderThickness="1" />
-
- </Grid>
-
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!--#endregion-->
-
- <!--#region 历史报警信息-->
- <ItemsControl ItemsSource="{Binding HistoryAlarm}" Visibility="{Binding HistoryDataVis}" Grid.ColumnSpan="2">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid x:Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.5*" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Id}" />
-
- <Grid Grid.Column="1">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Date}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Time}" />
-
- <Grid Grid.Column="3">
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Left"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Info}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="4"
- Style="{StaticResource DataTextBlockStyle}"
- Text="{Binding Value}" />
-
- <Grid Grid.Column="5">
- <TextBlock Style="{StaticResource DataTextBlockStyle}" Text="{Binding Grade}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <Border
- Grid.ColumnSpan="6"
- BorderBrush="{StaticResource BorderSolid}"
- BorderThickness="1" />
-
- </Grid>
-
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- <!--#endregion-->
- </Grid>
- </ScrollViewer>
- <!--#endregion-->
-
-
- </Grid>
-
- </UserControl>
|