Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style x:Key="UserMenuButton" TargetType="{x:Type Button}" BasedOn="{x:Null}">
- <Setter Property="FocusVisualStyle" Value="{DynamicResource SimpleButtonFocusVisual}"/>
- <Setter Property="Background" Value="#88BBBBBB"/>
- <Setter Property="BorderBrush" Value="#FFFFFFFF"/>
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Foreground" Value="#FF333333" />
- <Setter Property="FontSize" Value="18pt" />
- <Setter Property="FontWeight" Value="Bold" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="HorizontalContentAlignment" Value="Right" />
- <Setter Property="VerticalContentAlignment" Value="Bottom" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <!-- We use Grid as a root because it is easy to add more elements to customize the button -->
- <Grid x:Name="Grid">
- <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
- <!-- Content Presenter is where the text content etc is placed by the control -->
- <!-- The bindings are useful so that the control can be parameterized without editing the template -->
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <EventTrigger RoutedEvent="MouseEnter">
- <BeginStoryboard>
- <Storyboard>
- <ColorAnimation To="#FFBBBBBB" From="#88BBBBBB" Storyboard.TargetProperty="Background.Color" Duration="0:0:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <EventTrigger RoutedEvent="MouseLeave">
- <BeginStoryboard>
- <Storyboard Storyboard.TargetProperty="Background.Color">
- <ColorAnimation To="#88BBBBBB" From="#FFBBBBBB" Storyboard.TargetProperty="Background.Color" Duration="0:0:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value="0.25" />
- <Setter Property="Cursor" Value="{x:Null}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter Property="FontSize" Value="20pt" />
- </Trigger>
- </Style.Triggers>
- </Style>
Advertisement
Add Comment
Please, Sign In to add comment