Why Would a Dependency-Property Implementation Crash My Application When I Provide a Default Value?
问题 Why would a dependency-property implementation crash my application when I provide a default value? This segment of code is in the class declaration for my UserControl object. Everything works fine - it compiles and runs perfectly. public static System.Windows.DependencyProperty DepProp = System.Windows.DependencyProperty.Register( "Rect", typeof(System.Windows.Shapes.Rectangle), typeof(FooControl)); public System.Windows.Shapes.Rectangle Rect { get { return ((System.Windows.Shapes.Rectangle)