0

我有这个代码,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 上使用它时ComboboxControlTemplate不起作用:

<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更新。关于为什么的任何想法?

4

0 回答 0