Window.xaml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:hc="clr-namespace:HandyControl.Controls"
  4. xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
  5. <LinearGradientBrush x:Key="ResizeGripperForeground" EndPoint="1,0.75" StartPoint="0,0.25">
  6. <GradientStop Color="#FFFFFF" Offset="0.3"/>
  7. <GradientStop Color="#BBC5D7" Offset="0.75"/>
  8. <GradientStop Color="#6D83A9" Offset="1"/>
  9. </LinearGradientBrush>
  10. <Style TargetType="ResizeGrip">
  11. <Setter Property="MinWidth" Value="11"/>
  12. <Setter Property="MinHeight" Value="11"/>
  13. <Setter Property="Width" Value="11"/>
  14. <Setter Property="Height" Value="11"/>
  15. <Setter Property="Background" Value="Transparent"/>
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="ResizeGrip">
  19. <hc:SimplePanel Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
  20. <Path Width="11" Height="11" Data="M 9,0 L 11,0 L 11,11 L 0,11 L 0,9 L 3,9 L 3,6 L 6,6 L 6,3 L 9,3 z" HorizontalAlignment="Right" VerticalAlignment="Bottom">
  21. <Path.Fill>
  22. <DrawingBrush TileMode="Tile" Viewbox="0,0,3,3" Viewport="0,0,3,3" ViewportUnits="Absolute" ViewboxUnits="Absolute">
  23. <DrawingBrush.Drawing>
  24. <DrawingGroup>
  25. <GeometryDrawing Brush="{StaticResource ResizeGripperForeground}">
  26. <GeometryDrawing.Geometry>
  27. <RectangleGeometry Rect="0,0,2,2"/>
  28. </GeometryDrawing.Geometry>
  29. </GeometryDrawing>
  30. </DrawingGroup>
  31. </DrawingBrush.Drawing>
  32. </DrawingBrush>
  33. </Path.Fill>
  34. </Path>
  35. </hc:SimplePanel>
  36. </ControlTemplate>
  37. </Setter.Value>
  38. </Setter>
  39. </Style>
  40. <Style TargetType="Window">
  41. <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
  42. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
  43. <Setter Property="UseLayoutRounding" Value="True"/>
  44. </Style>
  45. <ControlTemplate x:Key="WindowWin10Template" TargetType="hc:Window">
  46. <Border SnapsToDevicePixels="True" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
  47. <Grid Margin="{TemplateBinding Padding}">
  48. <Grid.RowDefinitions>
  49. <RowDefinition Height="Auto"/>
  50. <RowDefinition/>
  51. </Grid.RowDefinitions>
  52. <Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}">
  53. <Grid.ColumnDefinitions>
  54. <ColumnDefinition/>
  55. <ColumnDefinition Width="Auto"/>
  56. </Grid.ColumnDefinitions>
  57. <StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
  58. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" hc:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  59. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  60. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  61. <Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  62. </StackPanel>
  63. <Grid Grid.Column="0">
  64. <Grid.ColumnDefinitions>
  65. <ColumnDefinition Width="Auto"/>
  66. <ColumnDefinition Width="Auto"/>
  67. <ColumnDefinition/>
  68. </Grid.ColumnDefinitions>
  69. <Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
  70. <interactivity:Interaction.Triggers>
  71. <interactivity:EventTrigger EventName="MouseDoubleClick">
  72. <interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
  73. </interactivity:EventTrigger>
  74. </interactivity:Interaction.Triggers>
  75. <Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
  76. </Button>
  77. <TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
  78. <TextBlock.Visibility>
  79. <MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
  80. <MultiBinding.Bindings>
  81. <Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
  82. <Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
  83. </MultiBinding.Bindings>
  84. </MultiBinding>
  85. </TextBlock.Visibility>
  86. </TextBlock>
  87. <ContentPresenter WindowChrome.IsHitTestVisibleInChrome="True" Grid.Column="2" x:Name="ContentPresenterMain" Content="{TemplateBinding NonClientAreaContent}"/>
  88. </Grid>
  89. </Grid>
  90. <AdornerDecorator Grid.Row="1">
  91. <ContentPresenter ClipToBounds="True"/>
  92. </AdornerDecorator>
  93. <ResizeGrip Width="10" Height="10" x:Name="ResizeGrip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1" IsTabStop="False" Visibility="Collapsed" WindowChrome.ResizeGripDirection="BottomRight" />
  94. </Grid>
  95. </Border>
  96. <ControlTemplate.Triggers>
  97. <Trigger Property="IsActive" Value="False">
  98. <Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
  99. <Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
  100. </Trigger>
  101. <Trigger Property="WindowState" Value="Maximized">
  102. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  103. <Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
  104. </Trigger>
  105. <Trigger Property="WindowState" Value="Normal">
  106. <Setter Property="Visibility" Value="Visible" TargetName="ButtonMax"/>
  107. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  108. </Trigger>
  109. <Trigger Property="ResizeMode" Value="NoResize">
  110. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMin"/>
  111. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  112. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  113. </Trigger>
  114. <Trigger Property="ResizeMode" Value="CanMinimize">
  115. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  116. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  117. </Trigger>
  118. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
  119. <Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  120. <Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  121. </Trigger>
  122. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
  123. <Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  124. <Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  125. </Trigger>
  126. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
  127. <Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  128. <Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  129. </Trigger>
  130. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
  131. <Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  132. <Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  133. </Trigger>
  134. <Trigger Property="WindowStyle" Value="None">
  135. <Setter Property="ShowNonClientArea" Value="False"/>
  136. </Trigger>
  137. <MultiTrigger>
  138. <MultiTrigger.Conditions>
  139. <Condition Property="ResizeMode" Value="CanResizeWithGrip"/>
  140. <Condition Property="WindowState" Value="Normal" />
  141. </MultiTrigger.Conditions>
  142. <Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
  143. </MultiTrigger>
  144. </ControlTemplate.Triggers>
  145. </ControlTemplate>
  146. <ControlTemplate x:Key="WindowWin10ExtendContentToNonClientTemplate" TargetType="hc:Window">
  147. <Border SnapsToDevicePixels="True" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
  148. <hc:SimplePanel Margin="{TemplateBinding Padding}">
  149. <AdornerDecorator>
  150. <hc:SimplePanel>
  151. <ContentPresenter ClipToBounds="True"/>
  152. <Grid Background="{TemplateBinding NonClientAreaBackground}" Name="PART_NonClientArea" TextElement.Foreground="{TemplateBinding NonClientAreaForeground}" VerticalAlignment="Top">
  153. <Grid.ColumnDefinitions>
  154. <ColumnDefinition/>
  155. <ColumnDefinition Width="Auto"/>
  156. </Grid.ColumnDefinitions>
  157. <StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
  158. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" hc:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  159. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  160. <Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  161. <Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" hc:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" hc:IconElement.Width="10" hc:IconElement.Height="10"/>
  162. </StackPanel>
  163. <Grid Grid.Column="0">
  164. <Grid.ColumnDefinitions>
  165. <ColumnDefinition Width="Auto"/>
  166. <ColumnDefinition Width="Auto"/>
  167. <ColumnDefinition/>
  168. </Grid.ColumnDefinitions>
  169. <Button Name="ButtonIcon" Visibility="{TemplateBinding Icon,Converter={StaticResource Object2VisibilityConverter}}" Command="{x:Static SystemCommands.ShowSystemMenuCommand}" Background="Transparent" Margin="10,0,0,0" WindowChrome.IsHitTestVisibleInChrome="True" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center">
  170. <interactivity:Interaction.Triggers>
  171. <interactivity:EventTrigger EventName="MouseDoubleClick">
  172. <interactivity:InvokeCommandAction Command="{x:Static SystemCommands.CloseWindowCommand}" />
  173. </interactivity:EventTrigger>
  174. </interactivity:Interaction.Triggers>
  175. <Image IsHitTestVisible="False" Source="{TemplateBinding Icon}" VerticalAlignment="Center" Width="16" Height="16"/>
  176. </Button>
  177. <TextBlock Grid.Column="1" Text="{TemplateBinding Title}" Padding="10,0,0,0" VerticalAlignment="Center">
  178. <TextBlock.Visibility>
  179. <MultiBinding Converter="{StaticResource BooleanArr2VisibilityConverter}">
  180. <MultiBinding.Bindings>
  181. <Binding Path="ShowTitle" RelativeSource="{RelativeSource TemplatedParent}"/>
  182. <Binding Path="Title" RelativeSource="{RelativeSource TemplatedParent}" Converter="{StaticResource Object2BooleanConverter}"/>
  183. </MultiBinding.Bindings>
  184. </MultiBinding>
  185. </TextBlock.Visibility>
  186. </TextBlock>
  187. </Grid>
  188. </Grid>
  189. </hc:SimplePanel>
  190. </AdornerDecorator>
  191. <ResizeGrip Width="10" Height="10" x:Name="ResizeGrip" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="1" IsTabStop="False" Visibility="Collapsed" WindowChrome.ResizeGripDirection="BottomRight" />
  192. </hc:SimplePanel>
  193. </Border>
  194. <ControlTemplate.Triggers>
  195. <Trigger Property="IsActive" Value="False">
  196. <Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
  197. </Trigger>
  198. <Trigger Property="WindowState" Value="Maximized">
  199. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  200. <Setter Property="Visibility" Value="Visible" TargetName="ButtonRestore"/>
  201. </Trigger>
  202. <Trigger Property="WindowState" Value="Normal">
  203. <Setter Property="Visibility" Value="Visible" TargetName="ButtonMax"/>
  204. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  205. </Trigger>
  206. <Trigger Property="ResizeMode" Value="NoResize">
  207. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMin"/>
  208. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  209. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  210. </Trigger>
  211. <Trigger Property="ResizeMode" Value="CanMinimize">
  212. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonMax"/>
  213. <Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
  214. </Trigger>
  215. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
  216. <Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  217. <Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  218. </Trigger>
  219. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
  220. <Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  221. <Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  222. </Trigger>
  223. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
  224. <Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  225. <Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  226. </Trigger>
  227. <Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
  228. <Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource TemplatedParent}}"/>
  229. <Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource TemplatedParent}}"/>
  230. </Trigger>
  231. <Trigger Property="WindowStyle" Value="None">
  232. <Setter Property="ShowNonClientArea" Value="False"/>
  233. </Trigger>
  234. <MultiTrigger>
  235. <MultiTrigger.Conditions>
  236. <Condition Property="ResizeMode" Value="CanResizeWithGrip"/>
  237. <Condition Property="WindowState" Value="Normal" />
  238. </MultiTrigger.Conditions>
  239. <Setter TargetName="ResizeGrip" Property="Visibility" Value="Visible" />
  240. </MultiTrigger>
  241. </ControlTemplate.Triggers>
  242. </ControlTemplate>
  243. <Style x:Key="WindowWin10" TargetType="hc:Window">
  244. <Setter Property="BorderThickness" Value="1"/>
  245. <Setter Property="BorderBrush" Value="#262e2f"/>
  246. <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
  247. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
  248. <Setter Property="UseLayoutRounding" Value="True"/>
  249. <Setter Property="NonClientAreaBackground" Value="{DynamicResource RegionBrush}"/>
  250. <Setter Property="NonClientAreaForeground" Value="{DynamicResource PrimaryTextBrush}"/>
  251. <Setter Property="CloseButtonBackground" Value="Transparent"/>
  252. <Setter Property="CloseButtonForeground" Value="{DynamicResource PrimaryTextBrush}"/>
  253. <Setter Property="CloseButtonHoverBackground" Value="#e81123"/>
  254. <Setter Property="CloseButtonHoverForeground" Value="White"/>
  255. <Setter Property="OtherButtonBackground" Value="Transparent"/>
  256. <Setter Property="OtherButtonForeground" Value="{DynamicResource PrimaryTextBrush}"/>
  257. <Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkMaskBrush}"/>
  258. <Setter Property="OtherButtonHoverForeground" Value="{DynamicResource PrimaryTextBrush}"/>
  259. <Setter Property="Template" Value="{StaticResource WindowWin10Template}"/>
  260. <Style.Triggers>
  261. <Trigger Property="hc:WindowAttach.ExtendContentToNonClientArea" Value="true">
  262. <Setter Property="Template" Value="{StaticResource WindowWin10ExtendContentToNonClientTemplate}"/>
  263. </Trigger>
  264. </Style.Triggers>
  265. </Style>
  266. <Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="hc:BlurWindow">
  267. <Setter Property="Background" Value="Transparent"/>
  268. </Style>
  269. <Style x:Key="WindowGlow" BasedOn="{StaticResource WindowWin10}" TargetType="hc:GlowWindow">
  270. <Setter Property="ActiveGlowColor" Value="#262e2f"/>
  271. <Setter Property="InactiveGlowColor" Value="{DynamicResource BorderColor}"/>
  272. <Setter Property="BorderThickness" Value="0"/>
  273. </Style>
  274. <Style TargetType="hc:ImageBrowser">
  275. <Setter Property="Background" Value="Transparent"/>
  276. <Setter Property="MinWidth" Value="400"/>
  277. <Setter Property="MinHeight" Value="250"/>
  278. <Setter Property="BorderThickness" Value="1"/>
  279. <Setter Property="BorderBrush" Value="Black"/>
  280. <Setter Property="ResizeMode" Value="NoResize"/>
  281. <Setter Property="Template">
  282. <Setter.Value>
  283. <ControlTemplate TargetType="hc:ImageBrowser">
  284. <ControlTemplate.Resources>
  285. <Storyboard x:Key="Storyboard1">
  286. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_PanelTop">
  287. <EasingDoubleKeyFrame KeyTime="0:0:.1" Value="1"/>
  288. </DoubleAnimationUsingKeyFrames>
  289. </Storyboard>
  290. <Storyboard x:Key="Storyboard2">
  291. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_PanelTop">
  292. <EasingDoubleKeyFrame KeyTime="0:0:.4" Value="0"/>
  293. </DoubleAnimationUsingKeyFrames>
  294. </Storyboard>
  295. </ControlTemplate.Resources>
  296. <Grid>
  297. <Grid.RowDefinitions>
  298. <RowDefinition/>
  299. <RowDefinition Height="Auto"/>
  300. </Grid.RowDefinitions>
  301. <hc:ImageViewer x:Name="PART_ImageViewer" ShowImgMap="True" BorderThickness="0" Background="#dd000000"/>
  302. <hc:SimplePanel x:Name="PART_PanelTop" Opacity="0" Background="{DynamicResource DarkOpacityBrush}" VerticalAlignment="Top" Grid.Row="0">
  303. <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal">
  304. <TextBlock Text="{Binding ImgPath,ElementName=PART_ImageViewer}" Foreground="White" Margin="10,0,0,0"/>
  305. <TextBlock Text="{Binding ImgSize,ElementName=PART_ImageViewer,Converter={StaticResource Long2FileSizeConverter}}" Foreground="White" Margin="30,0,0,0"/>
  306. </StackPanel>
  307. <Button Command="interactivity:ControlCommands.Close" Foreground="{DynamicResource TextIconBrush}" WindowChrome.IsHitTestVisibleInChrome="True" Background="Red" Padding="14" hc:IconElement.Geometry="{StaticResource DeleteGeometry}" Style="{StaticResource ButtonIcon}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="40" Height="40"/>
  308. </hc:SimplePanel>
  309. </Grid>
  310. <ControlTemplate.Triggers>
  311. <Trigger SourceName="PART_ImageViewer" Property="ShowCloseButton" Value="True">
  312. <Trigger.EnterActions>
  313. <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
  314. </Trigger.EnterActions>
  315. <Trigger.ExitActions>
  316. <BeginStoryboard Storyboard="{StaticResource Storyboard2}"/>
  317. </Trigger.ExitActions>
  318. </Trigger>
  319. </ControlTemplate.Triggers>
  320. </ControlTemplate>
  321. </Setter.Value>
  322. </Setter>
  323. <Style.Triggers>
  324. <Trigger Property="IsFullScreen" Value="True">
  325. <Setter Property="WindowState" Value="Maximized"/>
  326. </Trigger>
  327. </Style.Triggers>
  328. </Style>
  329. </ResourceDictionary>