兼容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.

169 lines
9.5 KiB

<UserControl x:Class="AIK.Views.MenuPages.ChipWriteStart.ChipWriteStartPage"
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"
xmlns:local="clr-namespace:AIK.Views.MenuPages.ChipWriteStart"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<!-- 简单的样式资源 -->
<Style x:Key="ChipListItemStyle" TargetType="ListBoxItem">
<Setter Property="Padding" Value="10,8"/>
<Setter Property="Margin" Value="0,0,0,2"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Bd" Background="{TemplateBinding Background}"
BorderBrush="Transparent" BorderThickness="1" CornerRadius="4">
<ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#E3F2FD"/>
<Setter TargetName="Bd" Property="BorderBrush" Value="#2196F3"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#ECEFF1"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DropShadowEffect Color="Black" Opacity="0.25" BlurRadius="10" ShadowDepth="2" x:Key="DropShadowEffect"/>
</UserControl.Resources>
<Grid Margin="15">
<Grid.ColumnDefinitions>
<!-- 左侧芯片列表 -->
<ColumnDefinition Width="320" MinWidth="250"/>
<!-- 分割线 -->
<ColumnDefinition Width="5"/>
<!-- 右侧操作区域 -->
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- ================= 左侧:芯片列表 ================= -->
<Border Grid.Column="0" Background="White" CornerRadius="8" Effect="{StaticResource DropShadowEffect}" Margin="0,0,10,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 标题栏 -->
<Border Grid.Row="0" Background="#2C3E50" CornerRadius="8,8,0,0" Padding="15">
<TextBlock Text="可用芯片列表" Foreground="White" FontWeight="Bold" FontSize="16"/>
</Border>
<!-- 搜索框 (可选) -->
<Border Grid.Row="0" VerticalAlignment="Bottom" Margin="15,0,15,-32" Height="30">
<TextBox x:Name="TxtSearch" Text="搜索型号..." Foreground="Gray"
VerticalContentAlignment="Center" Padding="5"
/>
</Border>
<!-- 列表内容 -->
<ListBox Grid.Row="1" x:Name="LstChips"
ItemContainerStyle="{StaticResource ChipListItemStyle}"
Margin="10,40,10,10" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="{Binding ModelName}" FontWeight="SemiBold" FontSize="14" Foreground="#333"/>
<TextBlock Text="{Binding Frequency}" FontSize="11" Foreground="#777" Margin="0,2,0,0"/>
</StackPanel>
<!-- 状态指示器 -->
<Border Grid.Column="1" Background="{Binding StatusColor}"
CornerRadius="10" Padding="6,2" MinWidth="50" HorizontalAlignment="Right">
<TextBlock Text="{Binding StatusText}" Foreground="White" FontSize="10" HorizontalAlignment="Center"/>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- 底部统计 -->
<Border Grid.Row="2" Background="#F0F2F5" Padding="10" CornerRadius="0,0,8,8">
<TextBlock x:Name="TxtCount" Text="共 0 款芯片" FontSize="12" Foreground="#666" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<!-- 分割线 (可拖动效果需额外代码,此处仅为视觉) -->
<GridSplitter Grid.Column="1" Width="5" Background="Transparent" HorizontalAlignment="Stretch"/>
<Border Grid.Column="1" Width="1" Background="#DDD" HorizontalAlignment="Left"/>
<!-- ================= 右侧:操作区域 (待定功能预留) ================= -->
<Border Grid.Column="2" Background="White" CornerRadius="8" Effect="{StaticResource DropShadowEffect}" Margin="10,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 顶部:设备状态与当前选中芯片 -->
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="20">
<Border Background="#E8F5E9" BorderBrush="#4CAF50" BorderThickness="1" CornerRadius="4" Padding="10,5">
<StackPanel Orientation="Horizontal">
<Ellipse Width="10" Height="10" Fill="#4CAF50" Margin="0,0,8,0"/>
<TextBlock Text="设备已连接:AIK K3Tool" Foreground="#2E7D32" FontWeight="Bold" Margin="0,3,0,0"/>
</StackPanel>
</Border>
<TextBlock Text="|" Margin="15,0" Foreground="#CCC" VerticalAlignment="Center"/>
<StackPanel>
<TextBlock Text="当前选中:" FontSize="12" Foreground="#888"/>
<TextBlock x:Name="TxtSelectedChip" Text="未选择芯片" FontWeight="Bold" Foreground="#2C3E50" FontSize="14"/>
</StackPanel>
</StackPanel>
<!-- 中部:主要工作区 (您可以在此放置进度条、图片、表单等) -->
<Border Grid.Row="1" Margin="20,0,20,20" BorderBrush="#EEE" BorderThickness="1" CornerRadius="6" Background="#FAFAFA">
<Grid>
<!-- 占位符内容 -->
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.5">
<Path Data="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z"
Fill="#BDC3C7" Width="60" Height="60" Stretch="Uniform"/>
<TextBlock Text="请在左侧选择芯片型号以开始写启动流程"
FontSize="16" Foreground="#95A5A6" Margin="0,15,0,0" TextAlignment="Center"/>
<TextBlock Text="右侧区域将显示:引脚定义 / 读写进度 / 成功提示"
FontSize="12" Foreground="#BDC3C7" Margin="0,5,0,0"/>
</StackPanel>
<!-- TODO: 未来在此处添加具体的 UserControl 或动态内容 -->
<ContentControl x:Name="WorkAreaContent"/>
</Grid>
</Border>
<!-- 底部:日志/状态栏 -->
<Border Grid.Row="2" Background="#34495E" CornerRadius="0,0,8,8" Height="120" VerticalAlignment="Bottom">
<Grid>
<TextBlock Text="操作日志" Foreground="#BDC3C7" Margin="15,10,0,0" FontSize="12"/>
<TextBox x:Name="TxtLog"
Background="Transparent"
BorderThickness="0"
Foreground="#ECF0F1"
FontFamily="Consolas"
FontSize="12"
Margin="15,30,15,10"
IsReadOnly="True"
VerticalScrollBarVisibility="Auto"
TextWrapping="Wrap"/>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</UserControl>