WindowCommands.xaml 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <UserControl x:Class="MediaBrowser.UI.Controls.WindowCommands"
  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. mc:Ignorable="d"
  7. d:DesignHeight="300" d:DesignWidth="300">
  8. <UserControl.Resources>
  9. <Style TargetType="StackPanel" x:Key="WindowCommandsPanel">
  10. <Setter Property="Orientation" Value="Horizontal"/>
  11. <Setter Property="HorizontalAlignment" Value="Right"/>
  12. </Style>
  13. <Style TargetType="Button" x:Key="WebdingsButton" BasedOn="{StaticResource ImageButton}">
  14. <Setter Property="Margin" Value="0 0 15 0"/>
  15. <Setter Property="KeyboardNavigation.IsTabStop" Value="false"/>
  16. </Style>
  17. <Style TargetType="TextBlock" x:Key="WebdingsTextBlock">
  18. <Setter Property="FontFamily" Value="Webdings"/>
  19. <Setter Property="FontSize" Value="14"/>
  20. <Setter Property="Foreground" Value="{StaticResource DefaultForeground}"/>
  21. </Style>
  22. <Style TargetType="Button" x:Key="MinimizeApplicationButton" BasedOn="{StaticResource WebdingsButton}">
  23. <Setter Property="ToolTip" Value="Minimize"/>
  24. <Setter Property="Template">
  25. <Setter.Value>
  26. <ControlTemplate>
  27. <TextBlock Style="{StaticResource WebdingsTextBlock}">0</TextBlock>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. <Style TargetType="Button" x:Key="MaximizeApplicationButton" BasedOn="{StaticResource WebdingsButton}">
  33. <Setter Property="ToolTip" Value="Maximize"/>
  34. <Setter Property="Template">
  35. <Setter.Value>
  36. <ControlTemplate>
  37. <TextBlock Style="{StaticResource WebdingsTextBlock}">1</TextBlock>
  38. </ControlTemplate>
  39. </Setter.Value>
  40. </Setter>
  41. <Style.Triggers>
  42. <DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="Maximized">
  43. <Setter Property="Visibility" Value="Collapsed" />
  44. </DataTrigger>
  45. </Style.Triggers>
  46. </Style>
  47. <Style TargetType="Button" x:Key="UndoMaximizeApplicationButton" BasedOn="{StaticResource WebdingsButton}">
  48. <Setter Property="Visibility" Value="Collapsed"/>
  49. <Setter Property="ToolTip" Value="Restore"/>
  50. <Setter Property="Template">
  51. <Setter.Value>
  52. <ControlTemplate>
  53. <TextBlock Style="{StaticResource WebdingsTextBlock}">2</TextBlock>
  54. </ControlTemplate>
  55. </Setter.Value>
  56. </Setter>
  57. <Style.Triggers>
  58. <DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="Maximized">
  59. <Setter Property="Visibility" Value="Visible" />
  60. </DataTrigger>
  61. </Style.Triggers>
  62. </Style>
  63. <Style TargetType="Button" x:Key="CloseApplicationButton" BasedOn="{StaticResource WebdingsButton}">
  64. <Setter Property="ToolTip" Value="Close"/>
  65. <Setter Property="Template">
  66. <Setter.Value>
  67. <ControlTemplate>
  68. <TextBlock Style="{StaticResource WebdingsTextBlock}">r</TextBlock>
  69. </ControlTemplate>
  70. </Setter.Value>
  71. </Setter>
  72. </Style>
  73. </UserControl.Resources>
  74. <StackPanel Style="{StaticResource WindowCommandsPanel}">
  75. <Button x:Name="MinimizeApplicationButton" Style="{StaticResource MinimizeApplicationButton}"></Button>
  76. <Button x:Name="MaximizeApplicationButton" Style="{StaticResource MaximizeApplicationButton}"></Button>
  77. <Button x:Name="UndoMaximizeApplicationButton" Style="{StaticResource UndoMaximizeApplicationButton}"></Button>
  78. <Button x:Name="CloseApplicationButton" Style="{StaticResource CloseApplicationButton}"></Button>
  79. </StackPanel>
  80. </UserControl>