private static void OnWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VisibleColumnDefinition col = (VisibleColumnDefinition)d; if (!col.Visible && !col.visibleChanging) { col.storedWidth = (GridLength)e.NewValue; col.Width = new GridLength(0); } }
private static void OnMaxWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VisibleColumnDefinition col = (VisibleColumnDefinition)d; if (!col.Visible && !col.visibleChanging) { col.storedMaxWidth = (double)e.NewValue; col.MaxWidth = 0; } }
private static void OnVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { VisibleColumnDefinition col = (VisibleColumnDefinition)d; if (col.Visible) { col.visibleChanging = true; col.Width = col.storedWidth; col.MinWidth = col.storedMinWidth; col.MaxWidth = col.storedMaxWidth; col.visibleChanging = false; } else { col.visibleChanging = true; col.storedWidth = col.Width; col.storedMinWidth = col.MinWidth; col.storedMaxWidth = col.MaxWidth; col.MinWidth = 0d; col.Width = new GridLength(0); col.MaxWidth = 0d; col.visibleChanging = false; } }