Exemplo n.º 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);
        }
Exemplo n.º 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);
        }