所以基本上我有一个侧面三角形的按钮(用于“播放”按钮)。在 xaml 设计编辑器中,该按钮正确显示为三角形。但是,当我运行该应用程序时,它显示为一个标准的平淡无奇的 Windows 按钮。这里的风格:
<Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<ed:RegularPolygon x:Name="PlayerPlay" Fill="#FF080808" InnerRadius="1" PointCount="3" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="Black">
<ed:RegularPolygon.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="90.635"/>
<TranslateTransform/>
</TransformGroup>
</ed:RegularPolygon.RenderTransform>
</ed:RegularPolygon>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsDefaulted" Value="True"/>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
这是按钮:
<Button x:Name="PlayerPlay" Click="PlayerPlay_Click_1" Content="" Margin="63.54,4.752,59.686,6.682" Style="{DynamicResource ButtonStyle1}"/>
知道出了什么问题吗?
谢谢!