我正在尝试向网格动态添加一些路径,但这会生成一个无限循环,从而导致 SO。
private void SubLayout_Loaded(object sender, RoutedEventArgs e)
{
GeometryGroup myGeometryGroup = new GeometryGroup();
EllipseGeometry myEllipseGeometry = new EllipseGeometry();
myEllipseGeometry.Center = new Point(100, 41.5);
myEllipseGeometry.RadiusX = 5;
myEllipseGeometry.RadiusY = 5;
myGeometryGroup.Children.Add(myGeometryGroup);
points.Data = myGeometryGroup;
}
XAML:
<Path x:Name="points" Fill="Gold" Stroke="Black"
StrokeThickness="1"> </Path>
错误:
System.StackOverflowException 未处理