兼容win7版应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

400 lines
20 KiB

<UserControl x:Class="AIK.Views.MenuPages.IDCardCopy.AccessCardCopyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="820"
d:DesignWidth="1400">
<UserControl.Resources>
<Style x:Key="PageTitleStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#1976D2"/>
<Setter Property="FontSize" Value="32"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
</Style>
<Style x:Key="HintTitleStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#546E7A"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<Style x:Key="HintContentStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#78909C"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="LineHeight" Value="20"/>
<Setter Property="LineStackingStrategy" Value="BlockLineHeight"/>
</Style>
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#2196F3"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Padding" Value="14,10"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#1E88E5"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#1565C0"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#B0BEC5"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="SecondaryButtonStyle" TargetType="Button" BasedOn="{StaticResource PrimaryButtonStyle}">
<Setter Property="Background" Value="#81D4FA"/>
<Setter Property="Foreground" Value="#0D47A1"/>
</Style>
<Style x:Key="CardPanelStyle" TargetType="Border">
<Setter Property="Background" Value="#F9FBFD"/>
<Setter Property="BorderBrush" Value="#D9E4EC"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="18"/>
</Style>
<Style x:Key="CardHeaderStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#1976D2"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="0,0,0,16"/>
</Style>
<Style x:Key="FieldLabelStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#607D8B"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="FieldValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#1F2933"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="12,0,0,0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<Style x:Key="StatusChipStyle" TargetType="Border">
<Setter Property="Background" Value="#E3F2FD"/>
<Setter Property="CornerRadius" Value="14"/>
<Setter Property="Padding" Value="12,6"/>
<Setter Property="Margin" Value="0,0,12,0"/>
</Style>
<Style x:Key="TableHeaderTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#486581"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style x:Key="TableCellTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#1F2933"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
</UserControl.Resources>
<Grid Margin="10,10,20,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="220"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Style="{StaticResource PageTitleStyle}"
Text="IC/ID卡识别拷贝"
Margin="0,0,0,24"/>
<Border Grid.Row="1"
Background="#FFFFFF"
BorderBrush="#D6E4F0"
BorderThickness="1"
CornerRadius="10"
Padding="16"
Margin="0,0,0,20">
<WrapPanel>
<Border Style="{StaticResource StatusChipStyle}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="设备状态: " Foreground="#607D8B"/>
<TextBlock Text="{Binding DeviceStatus}" Foreground="#2E7D32" FontWeight="Bold"/>
</StackPanel>
</Border>
<Border Style="{StaticResource StatusChipStyle}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="读卡机状态: " Foreground="#607D8B"/>
<TextBlock Text="{Binding ReaderStatus}" Foreground="#EF6C00" FontWeight="Bold"/>
</StackPanel>
</Border>
<Border Style="{StaticResource StatusChipStyle}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="当前模式: " Foreground="#607D8B"/>
<TextBlock Text="{Binding CurrentMode}" Foreground="#1565C0" FontWeight="Bold"/>
</StackPanel>
</Border>
</WrapPanel>
</Border>
<Grid Grid.Row="2" Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.2*"/>
<ColumnDefinition Width="3.4*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="0,0,16,0">
<Grid.RowDefinitions>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1.2*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Style="{StaticResource CardPanelStyle}" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="{Binding SourceCard.Title}" Style="{StaticResource CardHeaderStyle}"/>
<UniformGrid Columns="2">
<Grid Margin="0,0,12,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="卡类型" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.CardType}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="卡号" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.CardNumber}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,12,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="UID" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.Uid}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="协议" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.Protocol}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,12,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="频率" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.Frequency}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="扇区数" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.SectorCount}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,12,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="可写状态" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.WritableStatus}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
<Grid Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="78"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="当前状态" Style="{StaticResource FieldLabelStyle}"/>
<TextBlock Grid.Column="1" Text="{Binding SourceCard.CurrentStatus}" Style="{StaticResource FieldValueStyle}"/>
</Grid>
</UniformGrid>
</StackPanel>
</Border>
<Border Grid.Row="1"
Background="#FFFFFF"
BorderBrush="#BFD7EA"
BorderThickness="1"
CornerRadius="12"
Padding="18">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="操作区"
Foreground="#1976D2"
FontSize="20"
FontWeight="Bold"
HorizontalAlignment="Center"
Margin="0,0,0,18"/>
<UniformGrid Grid.Row="1" Columns="3" Margin="0,0,0,12">
<Button Content="开始识别"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding IdentifyCommand}"
Margin="0,0,8,0"/>
<Button Content="开始拷贝"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding CopyCommand}"
IsEnabled="{Binding IsCopyEnabled}"
Margin="0,0,8,0"/>
<Button Content="清空数据"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearCommand}"/>
</UniformGrid>
</Grid>
</Border>
</Grid>
<Border Grid.Column="1"
Style="{StaticResource CardPanelStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="扇区块内容"
Style="{StaticResource CardHeaderStyle}"
Margin="0,0,0,12"/>
<Border Grid.Row="1"
Background="#F1F7FB"
BorderBrush="#D9E4EC"
BorderThickness="1"
CornerRadius="8"
Padding="14,10"
Margin="0,0,0,10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="扇区" Style="{StaticResource TableHeaderTextStyle}"/>
<TextBlock Grid.Column="1" Text="块" Style="{StaticResource TableHeaderTextStyle}"/>
<TextBlock Grid.Column="2" Text="内容" Style="{StaticResource TableHeaderTextStyle}"/>
</Grid>
</Border>
<ListBox Grid.Row="2"
ItemsSource="{Binding SectorBlockRows}"
BorderThickness="0"
Background="Transparent"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Background="#FFFFFF"
BorderBrush="#E1ECF4"
BorderThickness="1"
CornerRadius="8"
Padding="14,12"
Margin="0,0,0,8">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Sector}"
Style="{StaticResource TableCellTextStyle}"
FontWeight="SemiBold"
Foreground="#1565C0"/>
<TextBlock Grid.Column="1"
Text="{Binding Block}"
Style="{StaticResource TableCellTextStyle}"
Foreground="#486581"/>
<TextBlock Grid.Column="2"
Text="{Binding Content}"
Style="{StaticResource TableCellTextStyle}"
Margin="8,0,0,0"/>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
</Grid>
<Border Grid.Row="3"
Background="#FFFFFF"
BorderBrush="#D9E4EC"
BorderThickness="1"
CornerRadius="10"
Padding="16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Text="操作日志"
Foreground="#1976D2"
FontSize="16"
FontWeight="Bold"
Margin="0,0,0,10"/>
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled"
Template="{StaticResource MyScrollViewer}">
<ItemsControl ItemsSource="{Binding Logs}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="0,4,0,4">
<TextBlock Text="{Binding Time}"
Foreground="#607D8B"
Width="70"/>
<TextBlock Text="{Binding Message}"
Foreground="#1F2933"
TextWrapping="Wrap"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Border>
</Grid>
</UserControl>