如何将按钮绑定到silverlight中的集合? [英] how to bind buttons to collection in silverlight?

查看:71
本文介绍了如何将按钮绑定到silverlight中的集合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi。

我想在UI上动态创建按钮。

I want to create buttons dynamically on UI.

我想要 将按钮绑定到 集合,如果有四个集合

I want to  bind the button to the  collection so that if there are four collection

那么应该显示四个按钮。

then four button should be displayed.

推荐答案

您可以尝试将 ItemsControl 与您自己的 ItemTemplate 一起使用。

You can try to use ItemsControl with your own ItemTemplate.

顺便说一句,以下链接可能对您有所帮助:

By the way, the following links might be helpful to you:

http://stackoverflow.com/questions/806967/wpf-itemscontrol-data-binding-adding-extra-initial-controls

WPF:绑定到ObservableCollection的ItemsControl示例

 

愿这些信息对您有所帮助。

May this information is helpful to you.


这篇关于如何将按钮绑定到silverlight中的集合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆