Пример #1
0
        private void TheSplitterDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var myDoubleAnimation = new GridLengthAnimation {From = leftColumn.Width};

            if (leftColumn.Width.Value - 60 < 0)
            {
                myDoubleAnimation.To = _previousWidth;
            }
            else
            {
                myDoubleAnimation.To = new GridLength(0.0);
                _previousWidth = leftColumn.Width;
            }
            myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(0.5));
            myDoubleAnimation.AccelerationRatio = 0.95;
            leftColumn.BeginAnimation(ColumnDefinition.WidthProperty, myDoubleAnimation);
        }
Пример #2
0
        private void TheSplitterDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var myDoubleAnimation = new GridLengthAnimation {
                From = leftColumn.Width
            };

            if (leftColumn.Width.Value - 60 < 0)
            {
                myDoubleAnimation.To = _previousWidth;
            }
            else
            {
                myDoubleAnimation.To = new GridLength(0.0);
                _previousWidth       = leftColumn.Width;
            }
            myDoubleAnimation.Duration          = new Duration(TimeSpan.FromSeconds(0.5));
            myDoubleAnimation.AccelerationRatio = 0.95;
            leftColumn.BeginAnimation(ColumnDefinition.WidthProperty, myDoubleAnimation);
        }