[英]Setter for AutocompleteBox Doesn't Trigger
I need to the property in the class to update as selecteditems are changed. 我需要对类中的属性进行更新,因为selecteditems会更改。 But when I set a breakpoint for the setter, it's never actually fired. 但是,当我为设置器设置断点时,它实际上从未触发过。 May I ask how do I get around this? 请问我该如何解决?
<telerik:RadAutoCompleteBox ....
SelectedItems"{Binding Occurence.Appointment.SelectedAttendees, Mode=TwoWay}"
.../>
CustomAppointment.cs CustomAppointment.cs
public BindableCollection<AttendeeSearchDTO> SelectedAttendees
{
get
{
return selectedAttendees;
}
set
{
if (selectedAttendees != value)
{
selectedAttendees = value;
this.OnPropertyChanged(() => this.SelectedAttendees);
}
}
}
I can set a break point for other components such as below, and it fires completely fine. 我可以为其他组件(例如下面)设置一个断点,并且可以正常触发。
<TextBox Text="{Binding Occurrence.Appointment.Body, Mode=TwoWay}" />
Try to use ObservableCollection instead of BindableCollection 尝试使用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.