MahApps Metro probvides에서 SquareButtonStyle에 1 픽셀 경계가 없음을 알았습니다. 나는이 스타일의 라인을 따라 뭔가 얻을 찾고 :MahApps Metro에서 SqaureButton 스타일 덮어 쓰기
을 (비주얼 스튜디오의 버튼 스타일) 그리고 메트로 스타일은 다음과 같이이다 : 나는 보았다
단추 스타일에 대한 XAML을 통해 표시되지만 단추의 테두리 두께가 1임을 나타냅니다. 위의 단추와 같이 다른 단추의 테두리가 1 인 경우 어떻게 될 수 있습니까? 어떻게하면이 버튼을 덮어 쓰게 될까요?
이<Style x:Key="SquareButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="MinHeight"
Value="25" />
<Setter Property="FontFamily"
Value="{DynamicResource DefaultFont}" />
<Setter Property="FontWeight"
Value="SemiBold" />
<Setter Property="Background"
Value="{DynamicResource WhiteBrush}" />
<Setter Property="BorderBrush"
Value="{DynamicResource BlackBrush}" />
<Setter Property="Foreground"
Value="{DynamicResource TextBrush}" />
<Setter Property="Padding"
Value="5,6" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="MouseOverBorder">
<EasingDoubleKeyFrame KeyTime="0"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="MouseOverBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="2" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="PressedBorder">
<EasingDoubleKeyFrame KeyTime="0"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="MouseOverBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="0" />
</ThicknessAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="PressedBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="2" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="DisabledVisualElement">
<SplineDoubleKeyFrame KeyTime="0"
Value="0.7" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="contentPresenter">
<EasingDoubleKeyFrame KeyTime="0"
Value="0.3" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused" />
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid" />
<VisualState x:Name="InvalidFocused" />
<VisualState x:Name="InvalidUnfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Background"
BorderBrush="{DynamicResource BlackBrush}"
BorderThickness="2"
Background="{TemplateBinding Background}" />
<Rectangle x:Name="DisabledVisualElement"
Fill="{DynamicResource ControlsDisabledBrush}"
IsHitTestVisible="false"
Opacity="0" />
<Border x:Name="MouseOverBorder"
Background="{DynamicResource GrayBrush8}"
Opacity="0" />
<Border x:Name="PressedBorder"
Background="{DynamicResource BlackBrush}"
Opacity="0"
BorderBrush="{DynamicResource BlackBrush}" />
<ContentPresenter x:Name="contentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content, Converter={StaticResource ToLowerConverter}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
OpacityMask="{x:Null}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Foreground"
Value="{DynamicResource BlackBrush}" />
</Trigger>
<Trigger Property="IsPressed"
Value="true">
<Setter Property="Foreground"
Value="{DynamicResource WhiteBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
좋아, 내가 시도하고 변경됩니다 모자 :
https://github.com/joazlazer/ModdingStudio/blob/master/ModdingStudio/ModdingStudio/Themes/Buttons.xaml
그것은 나에게이 있습니다. 왜 그 말은 borderThickness = "1"이 맨 위에 올까요? –