I have a problem with ObservableCollection Class. I cant resolve this.
using System.Collections.ObjectModel;
#region ViewModelProperty: CustomerList
private ObservableCollection<T> _customerList = new ObservableCollection<T>();
public ObservableCollection<T> CustomerList
{
get
{
return _customerList;
}
set
{
_customerList = value;
OnPropertyChanged("CustomerList");
}
}
#endregion
My class with the ObservableCollection inherits ViewModelBase:
public abstract class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
any idea, where is the problem?
Tis just a placeholder. You need to supply an actual type somewhere forT.E.g. if you have
List<T>, you could make aList<int>orList<string>(Tis any other type which fits the given constraints). I.e.Tisintin the first case andstringin the second.