The property metadata of the Register method can take one to three arguments to it. The first one is the default value that we have seen earlier. The second one is the PropertyChangedCallback, which is to be called by the property system whenever the effective value of the property changes. The third one is the CoerceValueCallback, which is to be called whenever the property system calls System.Windows.DependencyObject.CoerceValue method against the property.
Most of the time, the property metadata is created using one to two parameters defining the default value and the property changed callback. Let's learn with an example demonstrating how this can be written:
public string PersonName { get { return (string)GetValue(PersonNameProperty); } set { SetValue(PersonNameProperty, value); } } public static readonly DependencyProperty PersonNameProperty = DependencyProperty.Register("PersonName", typeof(string),
typeof(MainWindow...