Last active
August 3, 2018 16:07
-
-
Save kusa-mochi/f1fb9b0630d5bd362af89181798a01ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ControlTemplate TargetType="{x:Type Button}"> | |
<Grid> | |
<Grid x:Name="HiddenGrid" Visibility="Hidden"> | |
<Grid.RowDefinitions> | |
<RowDefinition/> | |
<RowDefinition/> | |
<RowDefinition/> | |
<RowDefinition/> | |
</Grid.RowDefinitions> | |
<!-- ボタンの高さの1/4の値を取得するためだけに使うGrid --> | |
<Grid x:Name="CornerRadiusSizeGrid"/> | |
</Grid> | |
<!-- 左上と左下の角だけ丸いBorder(の派生クラス)--> | |
<local:PartialCornerBorder | |
x:Name="border" | |
BorderBrush="{TemplateBinding BorderBrush}" | |
BorderThickness="{TemplateBinding BorderThickness}" | |
Background="{TemplateBinding Background}" | |
SnapsToDevicePixels="true" | |
TopLeftCornerRadius="{Binding ActualHeight, ElementName=CornerRadiusSizeGrid}" | |
BottomLeftCornerRadius="{Binding ActualHeight, ElementName=CornerRadiusSizeGrid}"> | |
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> | |
</local:PartialCornerBorder> | |
</Grid> | |
<ControlTemplate.Triggers> | |
<!-- 略 --> | |
</ControlTemplate.Triggers> | |
</ControlTemplate> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment