wpf,怎么设计win8风格的按钮
wpf,如何设计win8风格的按钮
我说的是普通按钮,略带扁平化即可,如何设计??
如图:
------解决方案--------------------
重写button的style然后里面
------解决方案--------------------
参考下这个吧
我说的是普通按钮,略带扁平化即可,如何设计??
如图:
wpf
扁平化
button
------解决方案--------------------
重写button的style然后里面
<Style TargetType="{x:Type Button}">
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border BorderBrush="Gray" BorderThickness="1" Margin="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
------解决方案--------------------
参考下这个吧
<Style TargetType="Button">
<Setter Property="Foreground" Value="Black"/>
<!--修改模板属性-->
<Setter Property="Template">
<Setter.Value>
<!--控件模板-->
<ControlTemplate TargetType="Button">
<!--背景色-->
<Border x:Name="back" Opacity="0.8" CornerRadius="3">
<Border.BitmapEffect>
<OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />
</Border.BitmapEffect>
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
<GradientBrush.GradientStops>
<GradientStopCollection>