Я уже некоторое время использую System.Data.OracleClient
, и я не уверен, следует ли мне продолжать использовать его, если он устарел?
Хотя все мои страницы будут по-прежнему работать в среде .Net 4, я обеспокоен тем, что при появлении новой структуры все страницы могут перестать работать. { public List bList { get; set; } public void AddB(B b) { bList.Add(b); NotifyPropertyChanged("bList"); ...
I have a class:
public class A : INotifyPropertyChanged
{
public List<B> bList { get; set; }
public void AddB(B b)
{
bList.Add(b);
NotifyPropertyChanged("bList");
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
}
And a binding (DataContext of UserControl is an instance of A):
<ListBox ItemsSource="{Binding Path=bList}" />
Elements are shown, the ListBox is not updated after new object is added to List
After changing list to ObservableCollection and removing the NotifyPropertyChanged handler everything works.
Why the list is not working?