我有这个风格代码
<Window.Resources>
<Style x:Key="Mystyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid >
<Polygon Name="poly" Points="0,0 0,100 50,200"
Fill=" TemplateBinding Background}"
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Button Name="b1" Style="{StaticResource Mystyle }"></Button>
</Grid>
我需要根据一些计算在样式标签中为多边形设置点,而不是静态的,而是动态的,如何将点绑定到多边形。例如我有这个
PointCollection pc=this.CalculatePolygonPoints(new Point(0,0), 100,Orientation.Flat);
如何将此电脑绑定到我的多边形动态