【发布时间】:2014-10-04 00:39:26
【问题描述】:
我需要以最简单的形式了解如何在不使用 XAML 的情况下将 数据(字符串列表) 绑定到 ComboBox strong>ComboBox.ItemSource = object 在后面的代码中。
我的意思是这是什么:
{Binding Path="What Comes here"}
假设我有:
class Window1 : UserControl {
List<String> list = new List<String>();// And assign Value to this list
...}
我试过了
{Binding Path=list} or {Binding list}
但没有绑定任何内容。那么应该怎么做呢? (我无法在后面的代码中访问此组合框,因为 Microsoft 已将 SilverLight DatGrid 限制在一定程度上 我无法做到)
【问题讨论】:
标签: c# wpf xaml silverlight combobox