WPF当本类依赖属性发生变化时触发回调函数PropertyChangeCallBackHandler
程序员文章站
2022-06-08 22:21:58
...
//回调函数
private static void TotalPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((PagingDataGrid)d).RaisePageChanged();
}
/// <summary>
/// 依赖属性
/// </summary>
public static readonly DependencyProperty TotalProperty =
DependencyProperty.Register(
"Total",
typeof(int),
typeof(PagingDataGrid),
new FrameworkPropertyMetadata(
0,
FrameworkPropertyMetadataOptions.AffectsMeasure,
new PropertyChangedCallback(TotalPropertyChanged))
);