Implemented the interface INotifyPropertyChanged can inform UI to update the values.

If you have control bind to Book object and When you update the book object which has implemented the value, the control will update the values on UI accordingly.

 

public class Book : INotifyPropertyChanged { private bool _isPublished; private int _num; public string Title { get; set; } public List<string> Chapters { get; set; } public bool IsPublished { get { return _isPublished; } set { _isPublished = value; if (PropertyChanged != null) { PropertyChanged(this,new PropertyChangedEventArgs("IsPublished1")); } } } public int Quantity { get { return _num; } set { _num = value; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("Quantity")); } } } public event PropertyChangedEventHandler PropertyChanged; }

你可能感兴趣的:(UI,String,object,null,Class,interface)