【问题标题】:Binding to a Combo Box not working绑定到组合框不起作用
【发布时间】:2010-10-28 11:59:03
【问题描述】:

我在 WPF 窗口中有以下组合框绑定。我需要将窗口创建为 UserControl,因为这样做我的绑定不会显示 itemSource。

ComboBox Width="200" ItemsSource="{Binding CallerChoices}" SelectedValue="Sam" SelectedItem="{Binding CallerChoosen}"

Item 源 CallerChoices 是 .cs 页面上的 List 属性。

希望您能提供帮助,因为我环顾四周,它只是不断显示如何绑定到 XAML 中存储的项目

【问题讨论】:

    标签: wpf


    【解决方案1】:

    您是否检查过数据上下文或绑定的来源是否设置为正确的来源?

    Visual Studio 的输出窗口是否显示任何绑定错误?

    【讨论】:

      猜你喜欢
      • 2022-01-07
      • 2013-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多