DependencyProperty and DependencyObject is the core of WPF data binding.
We can use this two class to binding one class instead of using INotifyPropertyChanged
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.Windows; using System.Windows.Data; namespace WpfApplication1 { class Student : DependencyObject { public static readonly DependencyProperty NameProperty = DependencyProperty.Register("Name", typeof(string), typeof(Student)); public string Name { get { return (string)GetValue(NameProperty); } set { SetValue(NameProperty, value); } } //public BindingExpressionBase SetBinding(DependencyProperty dp, BindingBase binding) //{ // return BindingOperations.SetBinding(this, dp, binding); //} } }
while the other part can be the same as the code in ".NET WPF DataBinding".
In ease, we can key "propdp" and Tab key to edit every parameter in the function instead of key all the characters for the function.
Besides, there is one concept called Attached Properties that can attach new properties to existing class. This part can be referenced to the book