TaskConflictImageViewer.xaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <Window x:Class="aipdev.TaskConflictImageViewer"
  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:model="clr-namespace:AIPlatform.Protocol.Model;assembly=AIPlatform.Protocol"
  7. xmlns:local="clr-namespace:aipdev"
  8. mc:Ignorable="d"
  9. Title="图像浏览器" Height="768" Width="1024" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
  10. <Window.Resources>
  11. <Style TargetType="{x:Type TextBox}" x:Key="ReadOnlyTextBoxStyle">
  12. <Style.Setters>
  13. <Setter Property="IsReadOnly" Value="True"/>
  14. <Setter Property="Background" Value="Transparent"/>
  15. <Setter Property="Foreground" Value="White"/>
  16. <Setter Property="BorderThickness" Value="0"/>
  17. <Setter Property="HorizontalAlignment" Value="Left"/>
  18. <Setter Property="VerticalAlignment" Value="Center"/>
  19. </Style.Setters>
  20. </Style>
  21. </Window.Resources>
  22. <Grid Background="Black">
  23. <Grid.ColumnDefinitions>
  24. <ColumnDefinition Width="55"/>
  25. <ColumnDefinition Width="*"/>
  26. <ColumnDefinition Width="55"/>
  27. <ColumnDefinition Width="0.35*"/>
  28. </Grid.ColumnDefinitions>
  29. <Image x:Name="Image" Grid.Column="0" Grid.ColumnSpan="3"/>
  30. <Button Grid.Column="0" Margin="4,0,0,0" x:Name="PreviousImage" Width="64" Height="2000" OverridesDefaultStyle="True" Click="OnPreviousImageClick">
  31. <Button.Template>
  32. <ControlTemplate>
  33. <Grid x:Name="Bb" Width="64">
  34. <Border Background="Black" Opacity="0.5"></Border>
  35. <Border x:Name="Bib">
  36. <Image Opacity="0.5" x:Name="Bi" Width="50" Height="50" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center" Source="Resources/Images/Left.png"></Image>
  37. </Border>
  38. </Grid>
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="Button.IsMouseOver" Value="True">
  41. <Setter TargetName="Bi" Property="Opacity" Value="1"/>
  42. </Trigger>
  43. <Trigger Property="Button.IsPressed" Value="True">
  44. <Setter TargetName="Bib" Property="Padding" Value="2"/>
  45. </Trigger>
  46. </ControlTemplate.Triggers>
  47. </ControlTemplate>
  48. </Button.Template>
  49. </Button>
  50. <Button Grid.Column="2" Margin="0,0,4,0" x:Name="NextImage" Width="64" Height="1000" OverridesDefaultStyle="True" Click="OnNextImageClick">
  51. <Button.Template>
  52. <ControlTemplate>
  53. <Grid x:Name="Bb" Width="64">
  54. <Border Background="Black" Opacity="0.5"></Border>
  55. <Border x:Name="Bib">
  56. <Image Opacity="0.5" x:Name="Bi" Width="50" Height="50" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center" Source="Resources/Images/Right.png"></Image>
  57. </Border>
  58. </Grid>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="Button.IsMouseOver" Value="True">
  61. <Setter TargetName="Bi" Property="Opacity" Value="1"/>
  62. </Trigger>
  63. <Trigger Property="Button.IsPressed" Value="True">
  64. <Setter TargetName="Bib" Property="Padding" Value="2"/>
  65. </Trigger>
  66. </ControlTemplate.Triggers>
  67. </ControlTemplate>
  68. </Button.Template>
  69. </Button>
  70. <ScrollViewer Grid.Column="3" VerticalScrollBarVisibility="Auto">
  71. <StackPanel>
  72. <StackPanel Orientation="Horizontal" Margin="4">
  73. <TextBlock Text="当前图像:" FontSize="12" Foreground="White" VerticalAlignment="Center" IsHitTestVisible="False"/>
  74. <TextBlock x:Name="CurrentCaseImageIndex" FontSize="12" Foreground="White" VerticalAlignment="Center" IsHitTestVisible="False"/>
  75. <TextBlock Text="/" FontSize="12" Foreground="White" VerticalAlignment="Center" IsHitTestVisible="False"/>
  76. <TextBlock x:Name="TotalCaseImageCount" FontSize="12" Foreground="White" VerticalAlignment="Center" Margin="0,0,30,0" IsHitTestVisible="False"/>
  77. </StackPanel>
  78. <StackPanel Orientation="Horizontal" Margin="4">
  79. <TextBlock Text="跳转页面至第" FontSize="12" Foreground="White" VerticalAlignment="Center"/>
  80. <TextBox Height="18" FontSize="12" VerticalContentAlignment="Center" Padding="0" Margin="2,0" Width="50" HorizontalContentAlignment="Center" x:Name="LabeledImageIndexTextBox"
  81. PreviewKeyDown="LabeledImageIndexTextBox_PreviewKeyDown"/>
  82. <TextBlock Text="页" FontSize="12" Foreground="White" VerticalAlignment="Center"/>
  83. </StackPanel>
  84. <!--<GroupBox Margin="4" MinHeight="64" Header="图像标签" Foreground="White" BorderBrush="Gray" BorderThickness="1" >
  85. <StackPanel VerticalAlignment="Center">
  86. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" x:Name="CombinationTagNameTextBox" TextWrapping="Wrap" />
  87. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" x:Name="CombinationTagIdTextBox" TextWrapping="Wrap" />
  88. </StackPanel>
  89. </GroupBox>-->
  90. <GroupBox Margin="4" MinHeight="64" Header="图像信息" Foreground="White" BorderBrush="Gray" BorderThickness="0.5" >
  91. <StackPanel VerticalAlignment="Center">
  92. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" x:Name="ImageNameTextBox" TextWrapping="Wrap" />
  93. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" x:Name="ImageIdTextBox" TextWrapping="Wrap" />
  94. </StackPanel>
  95. </GroupBox>
  96. <StackPanel VerticalAlignment="Center" Margin="3,5,0,0">
  97. <TextBlock Foreground="White" Text="标注结论" VerticalAlignment="Center" HorizontalAlignment="Center" />
  98. </StackPanel>
  99. <ItemsControl x:Name="Conclusions">
  100. <ItemsControl.Resources>
  101. <DataTemplate DataType="{x:Type model:ConflictLabelConclusion}">
  102. <GroupBox BorderThickness="0.5" Foreground="White" BorderBrush="Gray" x:Name="ResultGroup" Header="{Binding Annotator}" PreviewMouseLeftButtonDown="OnResultMouseLeftButtonDown">
  103. <StackPanel>
  104. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" Text="{Binding ImageContent}" TextWrapping="Wrap"/>
  105. <TextBox Style="{StaticResource ReadOnlyTextBoxStyle}" Text="{Binding RoiContent}" TextWrapping="Wrap"/>
  106. </StackPanel>
  107. </GroupBox>
  108. <DataTemplate.Triggers>
  109. <!--鼠标经过样式-->
  110. <Trigger Property="Button.IsMouseOver" Value="True">
  111. <Setter TargetName="ResultGroup" Property="BorderBrush" Value="Yellow"/>
  112. </Trigger>
  113. </DataTemplate.Triggers>
  114. </DataTemplate>
  115. </ItemsControl.Resources>
  116. </ItemsControl>
  117. </StackPanel>
  118. </ScrollViewer>
  119. <local:WaitingSpinner Grid.Column="0" Grid.ColumnSpan="2" x:Name="Waiting"/>
  120. </Grid>
  121. </Window>