WPF当本类依赖属性发生变化时触发回调函数PropertyChangeCallBackHandler

	//回调函数
        private static void TotalPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ((PagingDataGrid)d).RaisePageChanged();
        }
        /// 
        /// 依赖属性
        /// 
        public static readonly DependencyProperty TotalProperty =
            DependencyProperty.Register(
            "Total", 
            typeof(int), 
            typeof(PagingDataGrid),
            new FrameworkPropertyMetadata(
                0, 
                FrameworkPropertyMetadataOptions.AffectsMeasure,
                new PropertyChangedCallback(TotalPropertyChanged))
            );

你可能感兴趣的:(WPF)