MainWindow.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <Window x:Class="AIDiagnosisDemo.Presentation.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d"
  7. Title="AI诊断" Height="450" Width="800" WindowStartupLocation="CenterScreen" WindowState="Maximized"
  8. WindowStyle="None" AllowsTransparency="True" StateChanged="Window_StateChanged">
  9. <Window.Resources>
  10. <Style x:Key="CaptionButtonStyleKey" TargetType="{x:Type Button}">
  11. <Setter Property="OverridesDefaultStyle" Value="True" />
  12. <Setter Property="Foreground" Value="Black" />
  13. <Setter Property="FontFamily" Value="Marlett" />
  14. <Setter Property="FontSize" Value="14" />
  15. <Setter Property="IsTabStop" Value="False" />
  16. <Setter Property="HorizontalContentAlignment" Value="Center" />
  17. <Setter Property="VerticalContentAlignment" Value="Center" />
  18. <Setter Property="Margin" Value="2" />
  19. <Setter Property="Padding" Value="1" />
  20. <Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="{x:Type Button}">
  24. <Border x:Name="border" Background="Transparent" SnapsToDevicePixels="True">
  25. <Border.Effect>
  26. <DropShadowEffect Opacity="0" />
  27. </Border.Effect>
  28. <VisualStateManager.VisualStateGroups>
  29. <VisualStateGroup x:Name="CommonStates">
  30. <VisualState x:Name="Normal">
  31. <Storyboard>
  32. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
  33. <EasingDoubleKeyFrame KeyTime="0" Value="0.6" />
  34. </DoubleAnimationUsingKeyFrames>
  35. </Storyboard>
  36. </VisualState>
  37. <VisualState x:Name="MouseOver">
  38. <Storyboard>
  39. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
  40. <EasingDoubleKeyFrame KeyTime="0" Value="1" />
  41. </DoubleAnimationUsingKeyFrames>
  42. </Storyboard>
  43. </VisualState>
  44. <VisualState x:Name="Pressed">
  45. <Storyboard>
  46. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
  47. <EasingDoubleKeyFrame KeyTime="0" Value="1" />
  48. </DoubleAnimationUsingKeyFrames>
  49. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.ShadowDepth)" Storyboard.TargetName="border">
  50. <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  51. </DoubleAnimationUsingKeyFrames>
  52. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.Color)" Storyboard.TargetName="border">
  53. <EasingColorKeyFrame KeyTime="0" Value="White" />
  54. </ColorAnimationUsingKeyFrames>
  55. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.Opacity)" Storyboard.TargetName="border">
  56. <EasingDoubleKeyFrame KeyTime="0" Value="0.6" />
  57. </DoubleAnimationUsingKeyFrames>
  58. </Storyboard>
  59. </VisualState>
  60. <VisualState x:Name="Disabled" />
  61. </VisualStateGroup>
  62. </VisualStateManager.VisualStateGroups>
  63. <ContentPresenter x:Name="contentPresenter" Focusable="False" Margin="{TemplateBinding Padding}"
  64. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  65. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  66. </Border>
  67. </ControlTemplate>
  68. </Setter.Value>
  69. </Setter>
  70. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  71. </Style>
  72. </Window.Resources>
  73. <WindowChrome.WindowChrome>
  74. <WindowChrome CaptionHeight="{x:Static SystemParameters.CaptionHeight}"
  75. ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" CornerRadius="4" />
  76. </WindowChrome.WindowChrome>
  77. <Grid>
  78. <Grid.RowDefinitions>
  79. <RowDefinition Height="Auto" />
  80. <RowDefinition Height="*" />
  81. </Grid.RowDefinitions>
  82. <Grid.ColumnDefinitions>
  83. <ColumnDefinition Width="4*" />
  84. <ColumnDefinition Width="*" />
  85. </Grid.ColumnDefinitions>
  86. <Grid Grid.Row="0" Grid.ColumnSpan="2">
  87. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
  88. <Image Source="/AIDiagnosisDemo;component/App.ico" Width="30" VerticalAlignment="Bottom" Margin="10,0,0,0" />
  89. <TextBlock Text="AI诊断" VerticalAlignment="Bottom" FontSize="16" Margin="0,0,10,2" />
  90. <Border BorderThickness="1" Width="1" BorderBrush="Black" Height="20" VerticalAlignment="Bottom" />
  91. <Button Click="OnOpenSettingWindow" Background="Transparent" BorderThickness="0" VerticalAlignment="Bottom" Width="30" Margin="10,10,0,0"
  92. WindowChrome.IsHitTestVisibleInChrome="True" ToolTip="系统设置" Cursor="Hand">
  93. <Button.Template>
  94. <ControlTemplate>
  95. <Image Source="../Resources/Images/Setting.png" />
  96. </ControlTemplate>
  97. </Button.Template>
  98. </Button>
  99. </StackPanel>
  100. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,15,0">
  101. <Button Content="0" Style="{DynamicResource CaptionButtonStyleKey}" Click="OnMinClick" />
  102. <Button x:Name="MaxButton" Content="1" Style="{DynamicResource CaptionButtonStyleKey}" Click="OnMaxClick" />
  103. <Button x:Name="RestoreButton" Content="2" Style="{DynamicResource CaptionButtonStyleKey}" Click="OnRestoreClick" />
  104. <Button Content="r" Style="{DynamicResource CaptionButtonStyleKey}" Click="OnCloseClick" />
  105. </StackPanel>
  106. </Grid>
  107. <Grid Grid.Row="1" Grid.Column="0" Margin="5,5,0,5" Background="Black" SizeChanged="CanvasSizeChanged" MouseMove="Grid_MouseMove" MouseLeave="Grid_MouseLeave">
  108. <Image x:Name="UsImage" Margin="5" ></Image>
  109. <Canvas x:Name="UsCanvas" Margin="5"></Canvas>
  110. <Button x:Name="PlayButton" Margin="10" Width="70" Height="70" Click="OnPlayClick" VerticalAlignment="Bottom" HorizontalAlignment="Right"
  111. Visibility="Collapsed">
  112. <Button.Template>
  113. <ControlTemplate>
  114. <Image Source="../Resources/Images/Play.png" />
  115. </ControlTemplate>
  116. </Button.Template>
  117. </Button>
  118. <Button x:Name="PauseButton" Margin="10" Width="70" Height="70" Click="OnPauseClick" VerticalAlignment="Bottom" HorizontalAlignment="Right"
  119. Visibility="Collapsed">
  120. <Button.Template>
  121. <ControlTemplate>
  122. <Image Source="../Resources/Images/Pause.png" />
  123. </ControlTemplate>
  124. </Button.Template>
  125. </Button>
  126. </Grid>
  127. <Grid Grid.Row="1" Grid.Column="1" Margin="5,0,5,10">
  128. <Border Margin="5" CornerRadius="7" BorderThickness="1" BorderBrush="Black">
  129. <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
  130. <Grid>
  131. <Grid.RowDefinitions>
  132. <RowDefinition Height="Auto" />
  133. <RowDefinition Height="Auto" />
  134. <RowDefinition Height="Auto" />
  135. <RowDefinition Height="*" />
  136. </Grid.RowDefinitions>
  137. <ToggleButton Grid.Row="0" Content="心肌提取内轮廓" Click="OnExtractContours" x:Name="ExtractContoursBtn" Height="25"
  138. Width="100" Margin="5" HorizontalAlignment="Left"/>
  139. <StackPanel Grid.Row="1">
  140. <TextBlock x:Name="UsedStatusText" Margin="5" FontSize="15" TextWrapping="Wrap"/>
  141. <TextBlock x:Name="FPSText" Margin="5" FontSize="15" TextWrapping="Wrap"/>
  142. <TextBlock x:Name="ElapsedTimeText" Margin="5" FontSize="15" TextWrapping="Wrap"/>
  143. </StackPanel>
  144. <TextBlock x:Name="ResultInfoText" Margin="5" FontSize="15" TextWrapping="Wrap" Grid.Row="2" />
  145. <TextBlock x:Name="ErrorInfoText" Margin="5" FontSize="15" TextWrapping="Wrap" Grid.Row="3" />
  146. </Grid>
  147. </ScrollViewer>
  148. </Border>
  149. </Grid>
  150. </Grid>
  151. </Window>