WindowElementStyle.xaml 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:controls="clr-namespace:CyberX8_Themes.CustomControls"
  4. xmlns:local="CyberX8_Themes.Style">
  5. <Style TargetType="{x:Type controls:WindowButtonBase}">
  6. <Setter Property="Margin" Value="0 0 1 0"></Setter>
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type controls:WindowButtonBase}">
  10. <Border x:Name="bg" Background="Transparent" Width="25" Height="25">
  11. <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="1"></ContentPresenter>
  12. </Border>
  13. <!--<ControlTemplate.Triggers>
  14. <Trigger Property="IsMouseOver" Value="true">
  15. <Setter Property="Background" Value="#333" TargetName="bg"></Setter>
  16. <Setter Property="Opacity" Value="1" TargetName="content"></Setter>
  17. </Trigger>
  18. </ControlTemplate.Triggers>-->
  19. </ControlTemplate>
  20. </Setter.Value>
  21. </Setter>
  22. </Style>
  23. <Style TargetType="{x:Type controls:WindowButtonClose}">
  24. <Setter Property="Margin" Value="0 0 1 0"></Setter>
  25. <Setter Property="Template">
  26. <Setter.Value>
  27. <ControlTemplate TargetType="{x:Type controls:WindowButtonClose}">
  28. <Border x:Name="bg" Background="Transparent" Width="25" Height="25">
  29. <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.5" RenderTransformOrigin="0.5 0.5">
  30. <ContentPresenter.RenderTransform>
  31. <RotateTransform x:Name="angleRotateTransform" ></RotateTransform>
  32. </ContentPresenter.RenderTransform>
  33. </ContentPresenter>
  34. </Border>
  35. <ControlTemplate.Triggers>
  36. <Trigger Property="IsMouseOver" Value="true">
  37. <Setter Property="Background" Value="Red" TargetName="bg"></Setter>
  38. <Setter Property="Opacity" Value="1" TargetName="content"></Setter>
  39. <Trigger.EnterActions>
  40. <BeginStoryboard>
  41. <Storyboard>
  42. <DoubleAnimation Storyboard.TargetName="angleRotateTransform" Storyboard.TargetProperty="Angle"
  43. From="0" To="90" Duration="0:0:0.5">
  44. <DoubleAnimation.EasingFunction>
  45. <BackEase EasingMode="EaseInOut"></BackEase>
  46. </DoubleAnimation.EasingFunction>
  47. </DoubleAnimation>
  48. </Storyboard>
  49. </BeginStoryboard>
  50. </Trigger.EnterActions>
  51. <Trigger.ExitActions>
  52. <BeginStoryboard>
  53. <Storyboard>
  54. <DoubleAnimation Storyboard.TargetName="angleRotateTransform" Storyboard.TargetProperty="Angle"
  55. From="90" To="0" Duration="0:0:0.5">
  56. <DoubleAnimation.EasingFunction>
  57. <BackEase EasingMode="EaseInOut"></BackEase>
  58. </DoubleAnimation.EasingFunction>
  59. </DoubleAnimation>
  60. </Storyboard>
  61. </BeginStoryboard>
  62. </Trigger.ExitActions>
  63. </Trigger>
  64. </ControlTemplate.Triggers>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. </ResourceDictionary>