private static void OnHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisibleRowDefinition row = (VisibleRowDefinition)d;

            if (!row.Visible && !row.visibleChanging)
            {
                row.storedHeight = (GridLength)e.NewValue;
                row.Height       = new GridLength(0);
            }
        }
        private static void OnMaxHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisibleRowDefinition row = (VisibleRowDefinition)d;

            if (!row.Visible && !row.visibleChanging)
            {
                row.storedMaxHeight = (double)e.NewValue;
                row.MaxHeight       = 0;
            }
        }
        private static void OnVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisibleRowDefinition row = (VisibleRowDefinition)d;

            if (row.Visible)
            {
                row.visibleChanging = true;
                row.Height          = row.storedHeight;
                row.MinHeight       = row.storedMinHeight;
                row.MaxHeight       = row.storedMaxHeight;
                row.visibleChanging = false;
            }
            else
            {
                row.visibleChanging = true;
                row.storedHeight    = row.Height;
                row.storedMinHeight = row.MinHeight;
                row.storedMaxHeight = row.MaxHeight;
                row.MinHeight       = 0d;
                row.Height          = new GridLength(0);
                row.MaxHeight       = 0d;
                row.visibleChanging = false;
            }
        }