簡體   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