App.xaml 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <Application x:Class="Flyinsono.Client.Test.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:Flyinsono.Client.Test"
  5. StartupUri="MainWindow.xaml">
  6. <Application.Resources>
  7. <Style TargetType="Button">
  8. <Setter Property="Margin" Value="7"/>
  9. <Setter Property="Width" Value="80"/>
  10. </Style>
  11. <Style TargetType="TextBox">
  12. <Setter Property="Margin" Value="7"/>
  13. <Setter Property="MinWidth" Value="120"/>
  14. </Style>
  15. <Style x:Key="CommonButtonStyle" TargetType="Button" >
  16. <Setter Property="Margin" Value="7"/>
  17. <Setter Property="Width" Value="80"/>
  18. <Setter Property="Command" Value="{Binding}"/>
  19. <Setter Property="BorderBrush" Value="#4cae4c"/>
  20. <Setter Property="Background" Value="#5cb85c"/>
  21. <Setter Property="Foreground" Value="#fff"/>
  22. <Setter Property="Template">
  23. <Setter.Value>
  24. <ControlTemplate TargetType="Button">
  25. <Border CornerRadius="4" Name="container" Cursor="Hand" Padding="{TemplateBinding Padding}"
  26. BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}"
  27. Background="{TemplateBinding Background}">
  28. <ContentPresenter ContentSource="{TemplateBinding Content}"
  29. ContentTemplate="{TemplateBinding ContentTemplate}"
  30. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  31. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  32. <VisualStateManager.VisualStateGroups>
  33. <VisualStateGroup Name="CommonStates">
  34. <VisualState Name="Normal">
  35. </VisualState>
  36. <VisualState Name="MouseOver">
  37. <Storyboard>
  38. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
  39. Duration="0:0:0.02" To="#449d44"></ColorAnimation>
  40. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
  41. Duration="0:0:0.02" To="#398439"></ColorAnimation>
  42. </Storyboard>
  43. </VisualState>
  44. <VisualState Name="Pressed">
  45. <Storyboard>
  46. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
  47. Duration="0:0:0.02" To="#398439"></ColorAnimation>
  48. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
  49. Duration="0:0:0.02" To="#255625"></ColorAnimation>
  50. </Storyboard>
  51. </VisualState>
  52. <VisualState Name="Disabled">
  53. <Storyboard>
  54. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
  55. Duration="0:0:0.02" To="#5cb85c"></ColorAnimation>
  56. <ColorAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
  57. Duration="0:0:0.02" To="#4cae4c"></ColorAnimation>
  58. <DoubleAnimation Storyboard.TargetName="container" Storyboard.TargetProperty="Opacity"
  59. Duration="0:0:0.02" To="0.7"></DoubleAnimation>
  60. </Storyboard>
  61. </VisualState>
  62. </VisualStateGroup>
  63. </VisualStateManager.VisualStateGroups>
  64. </Border>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. </Application.Resources>
  70. </Application>