画布和绘画。
我想向画布添加不同的控件和集合。通过 XAML 绑定它们似乎很困难。我只能绑定一个集合。此外,我想添加从tiles -user 构建的背景图像。那么通过代码还是通过 XAML 处理它更好?
I would like to add to a canvas different controls and collections. It seems hard to bind them via XAML. I can bind only one collection.. Also i would like to add background image built from tiles -user. So is it better to handle it via code or via XAML ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,将画布设置为
ItemsControl.ItemsPanel
并将ItemsControl.ItemsSource
绑定到您希望画布显示的项目列表。看这个例子... http://forums.silverlight.net/p/29753/ 96439.aspx
您可以通过我们所说的
CompositeCollection
绑定到多个集合。请参阅页面底部的示例。http://msdn.microsoft.com/en-我们/library/system.windows.data.compositecollection.aspx
如何将 .PNG 图像设置为 WPF 表单的 TILED 背景图像?
For this set your canvas as the
ItemsControl.ItemsPanel
and bindingItemsControl.ItemsSource
to the list of items that you want your canvas to display.see this example... http://forums.silverlight.net/p/29753/96439.aspx
You can bind to mutliple collections through what we call
CompositeCollection
. see the example in the bottom of the page.http://msdn.microsoft.com/en-us/library/system.windows.data.compositecollection.aspx
How to set a .PNG image as a TILED background image for my WPF Form?