使用依赖项属性时,不会通过绑定调用Setter,而是直接更改值(使用SetValue或类似的东西).
尝试添加PropertyChangedCallback,并在其中设置断点以查看是否从GridView更改了值.
public static readonly DependencyProperty BoolProperty = DependencyProperty.Register("Bool", typeof(bool), typeof(TestRow), new UIPropertyMetadata(false, OnBoolChanged)); private static void OnBoolChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { //this method will be called everytime Bool changes value }