App.xaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <Application x:Class="NetTool.Client.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:NetTool.Client"
  5. StartupUri="MainWindow.xaml">
  6. <Application.Resources>
  7. <Style TargetType="Button">
  8. <Setter Property="MinHeight" Value="32" />
  9. <Setter Property="Padding" Value="14,0" />
  10. <Setter Property="Background" Value="White" />
  11. <Setter Property="Foreground" Value="#333333" />
  12. <Setter Property="BorderBrush" Value="#D5D5D5" />
  13. <Setter Property="BorderThickness" Value="1" />
  14. <Setter Property="FontSize" Value="13" />
  15. <Setter Property="Cursor" Value="Hand" />
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="Button">
  19. <Border x:Name="ButtonBorder"
  20. Background="{TemplateBinding Background}"
  21. BorderBrush="{TemplateBinding BorderBrush}"
  22. BorderThickness="{TemplateBinding BorderThickness}"
  23. CornerRadius="4"
  24. SnapsToDevicePixels="True">
  25. <ContentPresenter x:Name="ButtonContent"
  26. Margin="{TemplateBinding Padding}"
  27. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  28. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  29. RecognizesAccessKey="True"
  30. TextElement.Foreground="{TemplateBinding Foreground}" />
  31. </Border>
  32. <ControlTemplate.Triggers>
  33. <Trigger Property="IsMouseOver" Value="True">
  34. <Setter TargetName="ButtonBorder" Property="BorderBrush" Value="#BEBEBE" />
  35. </Trigger>
  36. <Trigger Property="IsPressed" Value="True">
  37. <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.86" />
  38. </Trigger>
  39. <Trigger Property="IsEnabled" Value="False">
  40. <Setter Property="Cursor" Value="Arrow" />
  41. <Setter TargetName="ButtonBorder" Property="Background" Value="#F5F5F5" />
  42. <Setter TargetName="ButtonBorder" Property="BorderBrush" Value="#DADADA" />
  43. <Setter TargetName="ButtonContent" Property="TextElement.Foreground" Value="#B9B9B9" />
  44. </Trigger>
  45. </ControlTemplate.Triggers>
  46. </ControlTemplate>
  47. </Setter.Value>
  48. </Setter>
  49. </Style>
  50. <Style x:Key="PrimaryButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
  51. <Setter Property="Background" Value="#1677FF" />
  52. <Setter Property="Foreground" Value="White" />
  53. <Setter Property="BorderBrush" Value="#1677FF" />
  54. </Style>
  55. </Application.Resources>
  56. </Application>