TaskConflictImageBrowser.xaml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <UserControl x:Class="aipdev.TaskConflictImageBrowser"
  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:aipdev"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <UserControl.Resources>
  10. <Style TargetType="{x:Type TextBox}" x:Key="ReadOnlyTextBoxStyle">
  11. <Style.Setters>
  12. <Setter Property="IsReadOnly" Value="True"/>
  13. <Setter Property="Background" Value="Transparent"/>
  14. <Setter Property="Foreground" Value="White"/>
  15. <Setter Property="BorderThickness" Value="0"/>
  16. <Setter Property="HorizontalAlignment" Value="Center"/>
  17. <Setter Property="VerticalAlignment" Value="Center"/>
  18. </Style.Setters>
  19. </Style>
  20. </UserControl.Resources>
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="48"/>
  24. <RowDefinition Height="*"/>
  25. </Grid.RowDefinitions>
  26. <Border Grid.Row="0" BorderThickness="0.5" BorderBrush="Gray">
  27. <Grid>
  28. <Grid.ColumnDefinitions>
  29. <ColumnDefinition Width="Auto"/>
  30. <ColumnDefinition Width="*"/>
  31. <ColumnDefinition Width="*"/>
  32. <ColumnDefinition Width="Auto"/>
  33. </Grid.ColumnDefinitions>
  34. <TextBlock x:Name="TaskName" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4" FontWeight="Bold" FontSize="20"/>
  35. <!--<TextBox Grid.Column="1"/>
  36. <Button Content="查找" Grid.Column="2" HorizontalAlignment="Left" Margin="10,0,0,0" Style="{StaticResource btn-primary}" Click="OnSearchImages"/>-->
  37. <Button Style="{StaticResource btn-danger}" Content="X" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="4" Click="OnCloseClick" Grid.Column="3"/>
  38. </Grid>
  39. </Border>
  40. <ListBox Grid.Row="1" x:Name="TaskImages">
  41. <ListBox.ItemsPanel>
  42. <ItemsPanelTemplate>
  43. <WrapPanel/>
  44. </ItemsPanelTemplate>
  45. </ListBox.ItemsPanel>
  46. <ListBox.ItemContainerStyle>
  47. <Style TargetType="ListBoxItem">
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate>
  51. <Button OverridesDefaultStyle="True" x:Name="ImageButton" Width="520" Height="520" Margin="8" Click="OnImageClick">
  52. <Button.Template>
  53. <ControlTemplate>
  54. <Border x:Name="ImageBorder" BorderThickness="0.5" BorderBrush="Gray" CornerRadius="4" Background="Black">
  55. <Grid>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="*"/>
  58. <RowDefinition Height="Auto"/>
  59. </Grid.RowDefinitions>
  60. <Image Source="{Binding PreviewImage}" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2"/>
  61. </Grid>
  62. </Border>
  63. <ControlTemplate.Triggers>
  64. <Trigger Property="IsMouseOver" Value="True">
  65. <Setter TargetName="ImageBorder" Property="BorderBrush" Value="DeepSkyBlue"/>
  66. <Setter TargetName="ImageBorder" Property="BorderThickness" Value="2"/>
  67. </Trigger>
  68. </ControlTemplate.Triggers>
  69. </ControlTemplate>
  70. </Button.Template>
  71. </Button>
  72. </ControlTemplate>
  73. </Setter.Value>
  74. </Setter>
  75. </Style>
  76. </ListBox.ItemContainerStyle>
  77. </ListBox>
  78. </Grid>
  79. </UserControl>