LinkingLabelWindow.xaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <Window x:Class="AIPractice.LabelEditor.LinkingLabelWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:AIPractice.LabelEditor"
  7. mc:Ignorable="d"
  8. Title="选择要关联的标签" Height="400" Width="200" ResizeMode="NoResize" WindowStyle="ToolWindow" WindowStartupLocation="CenterScreen" Padding="0">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="*"/>
  12. <RowDefinition Height="40"/>
  13. </Grid.RowDefinitions>
  14. <ListBox x:Name="LabelList">
  15. <ItemsControl.ItemTemplate>
  16. <DataTemplate DataType="{x:Type local:ImageLabelViewModel}">
  17. <TextBlock Margin="4,2,4,2" FontSize="14" Text="{Binding Title}"/>
  18. </DataTemplate>
  19. </ItemsControl.ItemTemplate>
  20. </ListBox>
  21. <Button Grid.Row="1" Width="64" HorizontalAlignment="Right" Margin="0,8,8,8" Click="OnOkClick">
  22. <Button.Template>
  23. <ControlTemplate>
  24. <Border x:Name="ButtonBorder" BorderThickness="1" BorderBrush="Gray" CornerRadius="2">
  25. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  26. <TextBlock Margin="2" VerticalAlignment="Center" Text="确定"/>
  27. </StackPanel>
  28. </Border>
  29. <ControlTemplate.Triggers>
  30. <Trigger Property="Button.IsMouseOver" Value="True">
  31. <Setter TargetName="ButtonBorder" Property="BorderBrush" Value="CadetBlue"/>
  32. </Trigger>
  33. <Trigger Property="Button.IsPressed" Value="True">
  34. <Setter TargetName="ButtonBorder" Property="Background" Value="Azure"/>
  35. </Trigger>
  36. </ControlTemplate.Triggers>
  37. </ControlTemplate>
  38. </Button.Template>
  39. </Button>
  40. </Grid>
  41. </Window>