Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. <Application x:Class="WpfApp1.App"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:WpfApp1"
  5. StartupUri="MainWindow.xaml">
  6. <Application.Resources>
  7. <Style TargetType="{x:Type Button}">
  8. <Setter Property="Background" Value="#373737" />
  9. <Setter Property="Foreground" Value="White" />
  10. <Setter Property="FontSize" Value="10" />
  11. <Setter Property="SnapsToDevicePixels" Value="True" />
  12.  
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="{x:Type Button}">
  16. <Border CornerRadius="4" Background="{TemplateBinding Background}">
  17. <Grid>
  18. <Path x:Name="PathIcon" Width="15" Height="25" Stretch="Fill" Fill="#4C87B3" HorizontalAlignment="Left" Margin="17,0,0,0" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z "/>
  19. <ContentPresenter x:Name="MyContentPresenter" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" />
  20. </Grid>
  21. </Border>
  22.  
  23. <ControlTemplate.Triggers>
  24. <Trigger Property="IsMouseOver" Value="True">
  25. <Setter Property="Background" Value="#E59400" />
  26. <Setter Property="Foreground" Value="White" />
  27. <Setter TargetName="PathIcon" Property="Fill" Value="Black" />
  28. </Trigger>
  29.  
  30. <Trigger Property="IsPressed" Value="True">
  31. <Setter Property="Background" Value="OrangeRed" />
  32. <Setter Property="Foreground" Value="White" />
  33. </Trigger>
  34. </ControlTemplate.Triggers>
  35. </ControlTemplate>
  36. </Setter.Value>
  37. </Setter>
  38. </Style>
  39. </Application.Resources>
  40. </Application>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement