标签:template nta base key height val content div res
<Style x:Key="Style.OkOperationButton" TargetType="ButtonBase"> <Setter Property="Width" Value="110" /> <Setter Property="Height" Value="44" /> <Setter Property="FontSize" Value="24" /> <Setter Property="Background" Value="#FF0087FF" /> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ButtonBase}"> <Border x:Name="Border" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" CornerRadius="22" Background="{TemplateBinding Background}"> <TextBlock x:Name="TextBlock" Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsPressed" Value="True"> <Setter Property="Background" Value="#FFfcac1c" /> <Setter TargetName="TextBlock" Property="Foreground" Value="#FFFFFFFF" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Border" Property="Background" Value="#4D0087FF" /> <Setter TargetName="TextBlock" Property="Foreground" Value="#4DFFFFFF" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
标签:template nta base key height val content div res
原文地址:https://www.cnblogs.com/Zhang9823/p/11926870.html