0
如何使绑定工作,以便在设计时我可以重新计算我需要渲染路径的三个poisitions。当有人更改自定义控件的大小?WPF usercontrol circlesector按钮
现在我只是试图连接到SizeChanged事件..
<Grid DataContext="{Binding ElementName=mainbutton}">
<Path Stroke="{Binding Path=BorderBrush}" StrokeThickness="1" Fill="{Binding Path=Foreground}">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure IsClosed="True" StartPoint="{Binding Path= CenterPoint}">
<PathFigure.Segments>
<PathSegmentCollection>
<!--<Path Stroke="Black" StrokeThickness="1" Data="M 180,180 L 271.9,88.1 A130,130 0 0 0 88.1,88.1 Z"/>-->
<LineSegment Point="{Binding Path= TopLeftPoint}"/>
<ArcSegment Point="{Binding Path= TopRightPoint}" Size="{Binding Path= Size}" IsLargeArc="False" SweepDirection="Clockwise" RotationAngle="0"/>
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
</Grid>