我有这个代码,ComboBox
它可以工作并将 绑定SelectedItem
到我的属性ViewModel
:
<dxe:ComboBoxEdit x:Name="luTeacher"
Margin="0,5,0,0"
AutoComplete="True"
ItemsSource="{Binding ddsTeachers.Data}"
SelectedItem="{Binding SelectedTeacher, Mode=TwoWay}"
ValueMember="UserId"
DisplayMember="FullName"/>
但是当我尝试复制它并在 a 上使用它时Combobox
它ControlTemplate
不起作用:
<dxe:ComboBoxEdit
HorizontalAlignment="Left"
Grid.Column="1"
Grid.Row="0"
Margin="0,0,0,4"
VerticalAlignment="Top"
Width="150"
AutoComplete="True"
ItemsSource="{Binding Path=ddsViewTeacher.Data, Source={StaticResource vm}}"
SelectedItem="{Binding SelectedNewTeacher,
Mode=TwoWay, Source={StaticResource vm}}"
DisplayMember="FullName"
ValueMember="UserId"/>
ItemsSource
作品,但不SelectedItem
更新。关于为什么的任何想法?