我正在研究 wpf 滑块,我想要滑块控件上的十字圆形按钮,我已经附上了图像,你能帮我写什么样式来附上吗?
我尝试了以下方式,但没有为我工作,它是根据创建的
<Style x:Key="RoundCorner" TargetType="{x:Type Button}">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="grid">
<Border x:Name="border" Background="Black" CornerRadius="15" BorderBrush="White" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" TextElement.FontFamily="Arial Rounded MT Bold" VerticalAlignment="Center" TextElement.FontWeight="Bold"></ContentPresenter>
</Border>
</Grid>
<!--<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="border">
<Setter.Value>
<RadialGradientBrush GradientOrigin="0.496,1.052">
<RadialGradientBrush.RelativeTransform>
<TransformGroup>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.5" ScaleY="0.5"/>
<TranslateTransform X="0.02" Y="0.02"/>
</TransformGroup>
</RadialGradientBrush.RelativeTransform>
</RadialGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>-->
</ControlTemplate>
</Setter.Value>
</Setter>
</Style