所选项目不会绑定到可观察的集合

时间:2014-02-05 18:05:33

标签: c# mvvm

我正在尝试根据从AutoCompleteBox中选择的项目来填充Observable Collection。我可以得到一些指导,告诉我哪里出错了。这不是我想要的方式 XAML:

<telerik:RadAutoCompleteBox x:Name="RadAmortAutoBox" HorizontalAlignment="Left" Grid.Column="1" Grid.Row="6" VerticalAlignment="Top" SelectedItems="{Binding AmortDates, Mode=OneWay}"
                                    ItemsSource="{Binding Payments}" DisplayMemberPath="PaymentNo" TextSearchPath="PaymentNo" Width="708" />

视图模型:

    public ObservableCollection<int> amortDates;

    public ObservableCollection<int> AmortDates
    {
        get { return amortDates; }
        set
        {
            amortDates = value;
            RaisePropertyChanged("AmortDates");
        }
    }

0 个答案:

没有答案