강좌 - wpf 데이터 바인딩

데이터 바인딩을 통해 DependencyProperty 값이 설정되지 않음
(1)

DependencyProperty 멤버가있는 클래스가 있습니다.

publicclassSomeClass:FrameworkElement{publicstaticreadonlyDependencyPropertySomeValueProperty=DependencyProperty.Register("SomeValue",typeof(int),typeof(SomeClass));newPropertyMetadata(newPropertyChangedCallback(OnSomeValuePropertyChanged)));publicintSomeValue{get{return(int)GetValue(SomeValueProperty);}set{SetValue(SomeValueProperty, value);}}publicintGetSomeValue(){// This is just a contrived example.// this.SomeValue always returns the default value for some reason,// not the current binding source valuereturnthis.SomeValue;}privatestaticvoidOnSomeValuePropertyChanged(DependencyObject target,DependencyPropertyChangedEventArgs e){// This method is supposed to be called when the SomeValue property// changes, but for some reason it is not}}