12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <UserControl x:Class="aipdev.TaskConflictImageBrowser"
- 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:aipdev"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <Style TargetType="{x:Type TextBox}" x:Key="ReadOnlyTextBoxStyle">
- <Style.Setters>
- <Setter Property="IsReadOnly" Value="True"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="White"/>
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="HorizontalAlignment" Value="Center"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- </Style.Setters>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="48"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Border Grid.Row="0" BorderThickness="0.5" BorderBrush="Gray">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
- <TextBlock x:Name="TaskName" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="4" FontWeight="Bold" FontSize="20"/>
- <!--<TextBox Grid.Column="1"/>
- <Button Content="查找" Grid.Column="2" HorizontalAlignment="Left" Margin="10,0,0,0" Style="{StaticResource btn-primary}" Click="OnSearchImages"/>-->
- <Button Style="{StaticResource btn-danger}" Content="X" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="4" Click="OnCloseClick" Grid.Column="3"/>
- </Grid>
- </Border>
- <ListBox Grid.Row="1" x:Name="TaskImages">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Button OverridesDefaultStyle="True" x:Name="ImageButton" Width="520" Height="520" Margin="8" Click="OnImageClick">
- <Button.Template>
- <ControlTemplate>
- <Border x:Name="ImageBorder" BorderThickness="0.5" BorderBrush="Gray" CornerRadius="4" Background="Black">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Image Source="{Binding PreviewImage}" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="2"/>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="ImageBorder" Property="BorderBrush" Value="DeepSkyBlue"/>
- <Setter TargetName="ImageBorder" Property="BorderThickness" Value="2"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Button.Template>
- </Button>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- </UserControl>
|