摘要:DependencyProperty
public static readonly DependencyProperty FocusedRowDataIndexProperty =
DependencyProperty.Register("FocusedRowDataIndex", typeof(int), typeof(GroupColumnGridCtrl), new PropertyMetadata(0, OnFocusedRowDataIndexPropertyChanged));
private static void OnFocusedRowDataIndexPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
GroupColumnGridCtrl grid = d as GroupColumnGridCtrl;
if (grid == null)
{
return;
}
grid.OnFocusedRowDataIndexChanged((int)e.NewValue, (int)e.OldValue);
}
// Make the property work in xaml
public int FocusedRowDataIndex
{
get { return (int)GetValue(FocusedRowDataIndexProperty); }
set { SetValue(FocusedRowDataIndexProperty, value); }
}