WindowHeader.xaml 6.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <UserControl x:Class="SonopostSearchTool.WindowHeader"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:SonopostSearchTool"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <Style x:Key="BaseButton" TargetType="{x:Type Button}">
  12. <Setter Property="Height" Value="20"/>
  13. <Setter Property="Width" Value="20"/>
  14. <Setter Property="BorderBrush" Value="White"/>
  15. <Setter Property="BorderThickness" Value="0"/>
  16. <Setter Property="Margin" Value="5"/>
  17. <Setter Property="VerticalAlignment" Value="Center"/>
  18. </Style>
  19. <Style x:Key="MinButton" BasedOn="{StaticResource BaseButton}" TargetType="{x:Type Button}">
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type Button}">
  23. <Grid Background="#01FFFFFF">
  24. <Path IsHitTestVisible="True" Fill="{TemplateBinding BorderBrush}" Data="M863.7 552.5H160.3c-10.6 0-19.2-8.6-19.2-19.2v-41.7c0-10.6 8.6-19.2 19.2-19.2h703.3c10.6 0 19.2 8.6 19.2 19.2v41.7c0 10.6-8.5 19.2-19.1 19.2z" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform"/>
  25. </Grid>
  26. <ControlTemplate.Triggers>
  27. <Trigger Property="IsMouseOver" Value="True">
  28. <Setter Property="BorderBrush" Value="#2561a9"/>
  29. <Setter Property="Background" Value="#ccdfeb"/>
  30. </Trigger>
  31. </ControlTemplate.Triggers>
  32. </ControlTemplate>
  33. </Setter.Value>
  34. </Setter>
  35. </Style>
  36. <Style x:Key="MaxButton" BasedOn="{StaticResource BaseButton}" TargetType="{x:Type Button}">
  37. <Setter Property="Template">
  38. <Setter.Value>
  39. <ControlTemplate TargetType="{x:Type Button}">
  40. <Grid Background="#01FFFFFF">
  41. <Path IsHitTestVisible="True" Fill="{TemplateBinding BorderBrush}" Data="M770.9 923.3H253.1c-83.8 0-151.9-68.2-151.9-151.9V253.6c0-83.8 68.2-151.9 151.9-151.9h517.8c83.8 0 151.9 68.2 151.9 151.9v517.8c0 83.8-68.1 151.9-151.9 151.9zM253.1 181.7c-39.7 0-71.9 32.3-71.9 71.9v517.8c0 39.7 32.3 71.9 71.9 71.9h517.8c39.7 0 71.9-32.3 71.9-71.9V253.6c0-39.7-32.3-71.9-71.9-71.9H253.1z" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform"/>
  42. </Grid>
  43. <ControlTemplate.Triggers>
  44. <Trigger Property="IsMouseOver" Value="True">
  45. <Setter Property="BorderBrush" Value="#2561a9"/>
  46. <Setter Property="Background" Value="#ccdfeb"/>
  47. </Trigger>
  48. </ControlTemplate.Triggers>
  49. </ControlTemplate>
  50. </Setter.Value>
  51. </Setter>
  52. </Style>
  53. <Style x:Key="CloseButton" BasedOn="{StaticResource BaseButton}" TargetType="{x:Type Button}">
  54. <Setter Property="Template">
  55. <Setter.Value>
  56. <ControlTemplate TargetType="{x:Type Button}">
  57. <Grid Background="#01FFFFFF">
  58. <Path IsHitTestVisible="True" Fill="{TemplateBinding BorderBrush}" Data="M551.424 512l195.072-195.072c9.728-9.728 9.728-25.6 0-36.864l-1.536-1.536c-9.728-9.728-25.6-9.728-35.328 0L514.56 475.136 319.488 280.064c-9.728-9.728-25.6-9.728-35.328 0l-1.536 1.536c-9.728 9.728-9.728 25.6 0 36.864L477.696 512 282.624 707.072c-9.728 9.728-9.728 25.6 0 36.864l1.536 1.536c9.728 9.728 25.6 9.728 35.328 0L514.56 548.864l195.072 195.072c9.728 9.728 25.6 9.728 35.328 0l1.536-1.536c9.728-9.728 9.728-25.6 0-36.864L551.424 512z" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform"/>
  59. </Grid>
  60. <ControlTemplate.Triggers>
  61. <Trigger Property="IsMouseOver" Value="True">
  62. <Setter Property="BorderBrush" Value="#2561a9"/>
  63. <Setter Property="Background" Value="#ccdfeb"/>
  64. </Trigger>
  65. </ControlTemplate.Triggers>
  66. </ControlTemplate>
  67. </Setter.Value>
  68. </Setter>
  69. </Style>
  70. </ResourceDictionary>
  71. </UserControl.Resources>
  72. <Grid Background="{StaticResource MainTheme}">
  73. <Grid.ColumnDefinitions>
  74. <ColumnDefinition Width="Auto"/>
  75. <ColumnDefinition Width="*"/>
  76. <ColumnDefinition Width="Auto"/>
  77. </Grid.ColumnDefinitions>
  78. <Image x:Name="WindowLogo" Source="pack://application:,,,/Resources/Images/SonoPost_Icon.ico" Width="35" Margin="10,0"/>
  79. <TextBlock Foreground="White" Grid.Column="1" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{DynamicResource Title}"/>
  80. <StackPanel Orientation="Horizontal" Grid.Column="2" VerticalAlignment="Center" Margin="10,0">
  81. <Button Style="{StaticResource MinButton}" Click="OnMinimumClick"></Button>
  82. <Button Style="{StaticResource MaxButton}" Click="OnMaximumClick"></Button>
  83. <Button Style="{StaticResource CloseButton}" Click="OnCloseClick"></Button>
  84. </StackPanel>
  85. </Grid>
  86. </UserControl>