public static void Main()
Console.WriteLine( "Set foo.Bar to 1" );
Console.WriteLine( "Set foo.Bar to 1 (assigning the same value)" );
Console.WriteLine( "Set foo.Bar to 2" );
public class Foo : DependencyObject
get { return (int) GetValue( BarProperty ); }
set { SetValue( BarProperty, value ); }
public static readonly DependencyProperty BarProperty =
DependencyProperty.Register(
propertyChangedCallback: new PropertyChangedCallback( OnBarChanged ) ) );
private static void OnBarChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
Console.WriteLine( "OnBarChanged: Property has changed from '{0}' to '{1}'", e.OldValue, e.NewValue );