StudentManager/StudentManager/Editor/CheckView.xaml
2024-09-11 18:51:52 +08:00

60 lines
2.7 KiB
XML

<UserControl x:Class="StudentManager.Editor.CheckView"
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:StudentManager.Editor"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ListBox ItemsSource="{Binding StudentDatas}"
SelectedItem="{Binding SelectedStudent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1">
<StackPanel>
<TextBlock Text="{Binding SelectedStudent.Name}"/>
<ListBox ItemsSource="{Binding CQDatas}"
SelectionChanged="ListBox_SelectionChanged">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
CommandParameter="DetailCheckView"
Command="{Binding DataContext.RegionTo ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding TotalCount}"/>
<TextBlock Text="{Binding CorrectCount}"/>
<TextBlock Text="{Binding Lesson}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Grid>
</Grid>
</UserControl>