AdjustAssignmentView.xaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <UserControl x:Class="AIPractice.LabellerServer.WPF.AdjustAssignmentView"
  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:AIPractice.LabellerServer.WPF"
  7. xmlns:viewModels="clr-namespace:AIPractice.LabellerServer.ViewModels"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="48"/>
  13. <RowDefinition Height="*"/>
  14. </Grid.RowDefinitions>
  15. <StackPanel Grid.Row="0" Orientation="Horizontal">
  16. <TextBlock Style="{StaticResource textblock-default}" Margin="4,8" VerticalAlignment="Center" Text="选择要调整的人员: " />
  17. <local:MultiSelector x:Name="AccountSelector" Margin="2,2,4,2" Height="36" Width="220" SelectUnSelectAll="OnSelectUnSelectAllAccounts" Refreshed="OnAccountsRefreshed">
  18. <local:MultiSelector.ItemTemplate>
  19. <DataTemplate DataType="{x:Type viewModels:AccountViewModel}">
  20. <CheckBox Margin="8,2,2,2" VerticalAlignment="Center" IsChecked="{Binding IsSelected}" Content="{Binding FriendlyName}"/>
  21. </DataTemplate>
  22. </local:MultiSelector.ItemTemplate>
  23. </local:MultiSelector>
  24. <Button Style="{StaticResource btn-primary}" Margin="24,4,4,4" Content="加载" Width="80" Height="32" HorizontalAlignment="Left" VerticalAlignment="Center" Click="OnLoadVirtualCasesClick"/>
  25. <Button Style="{StaticResource btn-warning}" Margin="4" Content="清除" Width="80" Height="32" HorizontalAlignment="Right" VerticalAlignment="Center" Click="OnClearClick"/>
  26. </StackPanel>
  27. <ScrollViewer Margin="4" Grid.Row="1" VerticalScrollBarVisibility="Auto">
  28. <ItemsControl x:Name="VirtualCaseList" >
  29. <ItemsControl.ItemTemplate>
  30. <DataTemplate DataType="{x:Type viewModels:VirtualCaseAccountViewModel}">
  31. <ContentControl Margin="2,4,2,4" Style="{StaticResource panel-default}" >
  32. <Grid>
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="Auto"/>
  35. <RowDefinition Height="*"/>
  36. </Grid.RowDefinitions>
  37. <ContentControl Grid.Row="0" Style="{StaticResource panel-heading-default}" Content="{Binding Name}"/>
  38. <ItemsControl Grid.Row="1" ItemsSource="{Binding Cases}">
  39. <ItemsControl.ItemTemplate>
  40. <DataTemplate DataType="{x:Type viewModels:VirtualCaseViewModel}">
  41. <Grid>
  42. <Grid.ColumnDefinitions>
  43. <ColumnDefinition Width="200"/>
  44. <ColumnDefinition Width="200"/>
  45. <ColumnDefinition Width="Auto"/>
  46. <ColumnDefinition Width="Auto"/>
  47. </Grid.ColumnDefinitions>
  48. <StackPanel Orientation="Horizontal" Grid.Column="0" Margin="8" VerticalAlignment="Center">
  49. <TextBlock Margin="2" VerticalAlignment="Center" Text="{Binding Name}"/>
  50. <TextBlock VerticalAlignment="Center" Text="("/>
  51. <TextBlock VerticalAlignment="Center" Text="{Binding Description}"/>
  52. <TextBlock VerticalAlignment="Center" Text=")"/>
  53. </StackPanel>
  54. <StackPanel Margin="8" Grid.Column="1" HorizontalAlignment="Center" Orientation="Horizontal">
  55. <TextBlock Foreground="{Binding Color}" VerticalAlignment="Center" Text="{Binding LeftCount}"/>
  56. <TextBlock Foreground="{Binding Color}" VerticalAlignment="Center" Text="(剩余)"/>
  57. <TextBlock Foreground="{Binding Color}" VerticalAlignment="Center" Text="/"/>
  58. <TextBlock Foreground="{Binding Color}" VerticalAlignment="Center" Text="{Binding TotalCount}"/>
  59. <TextBlock Foreground="{Binding Color}" VerticalAlignment="Center" Text="(总共)"/>
  60. </StackPanel>
  61. <Button Style="{StaticResource btn-primary}" Grid.Column="2" Margin="8" VerticalAlignment="Center" Content="撤销" Width="80" IsEnabled="{Binding NotStarted}" Click="OnRestoreCaseClick"/>
  62. <Button Style="{StaticResource btn-danger}" Grid.Column="3" Margin="8" VerticalAlignment="Center" Content="删除" Width="80" IsEnabled="{Binding NotStarted}" Click="OnDeleteCaseClick"/>
  63. </Grid>
  64. </DataTemplate>
  65. </ItemsControl.ItemTemplate>
  66. </ItemsControl>
  67. </Grid>
  68. </ContentControl>
  69. </DataTemplate>
  70. </ItemsControl.ItemTemplate>
  71. </ItemsControl>
  72. </ScrollViewer>
  73. </Grid>
  74. </UserControl>