WPF 布局/地图/迷宫生成器
我试图为用户提供用于在 WPF 中生成框布局的控件。我希望能够添加/删除行和列,并将每个框设置为以 0 度或 45 度旋转。结果将是一种正方形的蜂窝状。我正在考虑用 ListBox 和 WrapPanel 来解决这个问题,但经过思考,我认为 Canvas 可能更好。有没有我可以遵循的简单方法,或者只是画布位置的反复试验?
I'm trying to give a user controls for generating a layout of boxes in WPF. I'd like to be able to add/remove rows and columns and set each box to be rotated at either 0 or 45 degrees. The result would be a sort of honeycomb of squares. I was thinking of approaching this with a ListBox and WrapPanel but after thinking about it, I think a Canvas may be better. Is there any easy methodology I could follow or will it just be trial and error with canvas positions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这并不像我想象的那么困难。使用 Canvas 作为 ListBox 的 ItemsPanel 相对容易。
This wasn't nearly as difficult as I thought it would be. Using a Canvas as a ListBox's ItemsPanel was relatively easy.