Permalink
Browse files

use CornerRadius in MetroButton style

  • Loading branch information...
1 parent efdc5f8 commit d4ff9da467533eeee6959fe2ed3cf4755ce852ec @punker76 punker76 committed Feb 22, 2015
Showing with 11 additions and 9 deletions.
  1. +11 −9 MahApps.Metro/Styles/Controls.Buttons.xaml
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Converters="clr-namespace:MahApps.Metro.Converters"
- xmlns:controls="clr-namespace:MahApps.Metro.Controls">
+ xmlns:Controls="clr-namespace:MahApps.Metro.Controls">
<Converters:ToUpperConverter x:Key="ToUpperConverter" />
<Converters:ToLowerConverter x:Key="ToLowerConverter" />
@@ -297,6 +297,8 @@
<!-- style for default button -->
<Style TargetType="{x:Type Button}"
x:Key="MetroButton">
+ <Setter Property="Controls:ButtonHelper.CornerRadius"
+ Value="3" />
<Setter Property="MinHeight"
Value="25" />
<Setter Property="FontWeight"
@@ -321,13 +323,13 @@
<Grid>
<Border x:Name="Background"
Background="{TemplateBinding Background}"
- CornerRadius="3" />
+ CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ButtonHelper.CornerRadius), Mode=OneWay}" />
<Border x:Name="Border"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{x:Null}"
- CornerRadius="3" />
+ CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ButtonHelper.CornerRadius), Mode=OneWay}" />
<Rectangle x:Name="DisabledVisualElement"
Fill="{DynamicResource ControlsDisabledBrush}"
IsHitTestVisible="false"
@@ -343,13 +345,13 @@
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
<ControlTemplate.Triggers>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="False">
<Setter TargetName="contentPresenter"
Property="Content"
Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Content, Converter={StaticResource ToUpperConverter}}" />
</Trigger>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="True">
<Setter TargetName="contentPresenter"
Property="Content"
@@ -463,13 +465,13 @@
</Grid>
<ControlTemplate.Triggers>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="False">
<Setter TargetName="contentPresenter"
Property="Content"
Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Content, Converter={StaticResource ToLowerConverter}}" />
</Trigger>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="True">
<Setter TargetName="contentPresenter"
Property="Content"
@@ -563,13 +565,13 @@
</Grid>
<ControlTemplate.Triggers>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="False">
<Setter TargetName="contentPresenter"
Property="Content"
Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Content, Converter={StaticResource ToLowerConverter}}" />
</Trigger>
- <Trigger Property="controls:ButtonHelper.PreserveTextCase"
+ <Trigger Property="Controls:ButtonHelper.PreserveTextCase"
Value="True">
<Setter TargetName="contentPresenter"
Property="Content"

0 comments on commit d4ff9da

Please sign in to comment.