首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法为面指定名称

无法为面指定名称
EN

Stack Overflow用户
提问于 2013-01-13 00:48:57
回答 1查看 75关注 0票数 0

我正在尝试为一个多边形指定一个名称,但是visual studio一直给我一个异常:

代码语言:javascript
复制
'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'.

我的代码是:

代码语言:javascript
复制
        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;
        }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-13 00:56:17

我认为Name属性中不能包含非法字符,即逗号。请尝试使用下划线。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14295515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档