繁体   English   中英

自动完成框的设置器不会触发

[英]Setter for AutocompleteBox Doesn't Trigger

我需要对类中的属性进行更新,因为selecteditems会更改。 但是,当我为设置器设置断点时,它实际上从未触发过。 请问我该如何解决?

<telerik:RadAutoCompleteBox ....
                            SelectedItems"{Binding Occurence.Appointment.SelectedAttendees, Mode=TwoWay}"
                            .../>

CustomAppointment.cs

public BindableCollection<AttendeeSearchDTO> SelectedAttendees
{
    get
    {
        return selectedAttendees;
    }
    set
    {            
        if (selectedAttendees != value)
        {
            selectedAttendees = value;
            this.OnPropertyChanged(() => this.SelectedAttendees);
        }
    }
}

我可以为其他组件(例如下面)设置一个断点,并且可以正常触发。

<TextBox  Text="{Binding Occurrence.Appointment.Body, Mode=TwoWay}" />

尝试使用ObservableCollection而不是BindableCollection

public ObservableCollection <AttendeeSearchDTO> SelectedAttendees
{
    get
    {
        return selectedAttendees;
    }
    set
    {            
        if (selectedAttendees != value)
        {
            selectedAttendees = value;
            this.OnPropertyChanged(() => this.SelectedAttendees);
        }
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM