2016-05-16 52 views
0

我需要在選定項更改時更新類中的屬性。但是當我爲setter設置一個斷點時,它從來沒有真正被解僱。請問我該如何解決這個問題?自動完成框的設置程序不會觸發

<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}" /> 
+0

的您有RadAutoCompleteBox拼寫錯誤。 –

+0

你可以展示你的ViewModel嗎? –

回答

0

嘗試改用的ObservableCollection BindableCollection

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

沒有什麼區別,bindablecollection是ObservableCollection的擴展。但我已經嘗試了你的建議和相同的事情。 – Master

+0

更新你的xaml指的是這個:

+0

爲什麼我要更新我的xaml以指向靜態資源。這並不能回答這個問題。它必須是AutocompleteBox將集合存儲在字典中的事實。 – Master

相關問題