ポリゴンに名前を付けようとしていますが、VisualStudioで例外が発生し続けます。
'The invocation of the constructor on type 'Isometric_Turtle_Simulator.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.
私のコードは:
for (int a = 0; a < z; a++)
{
for (int b = 0; b < x; b++)
{
for (int c = 0; c < y; c++)
{
tile = getTile.genTile(worldData[a,b,c]);
tile.Name = a.ToString() + "," + b.ToString() + "," + c.ToString();
Canvas.SetTop(tile, posY);
Canvas.SetLeft(tile, posX);
mainCanvas.Children.Add(tile);
tile.MouseDown += (sender, e) => mouseDownEvent(sender, e);
posY = posY + 15;
posX = posX + 30;
}
posY = posY - 15 * (x - 1);
posX = posX - 30 * (y + 1);
}
posX = posXOrigin;
posY = posY - (35 + (15 * x));
Height = Height + 35;
mainCanvas.Height = Height;
}