Beispiel #1
0
        private void AnimateBounds(Rect bounds)
        {
            this.bounds = bounds;

            TimeSpan duration = TimeSpan.FromSeconds(.2);

            BoundsOffsetX.AnimateTo(this.bounds.Left, duration);
            BoundsOffsetY.AnimateTo(this.bounds.Top, duration);

            BoundsWidth.AnimateTo(this.bounds.Width, duration);
            BoundsHeight.AnimateTo(this.bounds.Height, duration);

            Dimensions.Visibility = Visibility.Visible;
            Dimensions.Text       = string.Format(@"{0} x {1}", this.bounds.Width, this.bounds.Height);
        }
Beispiel #2
0
        private void AnimateBounds(IntRect screenBounds)
        {
            this.screenBounds = screenBounds;
            bounds            = NativeMethods.ScreenToClient(this, this.screenBounds);

            TimeSpan duration = TimeSpan.FromSeconds(.2);

            BoundsOffsetX.AnimateTo(bounds.Left, duration);
            BoundsOffsetY.AnimateTo(bounds.Top, duration);

            BoundsWidth.AnimateTo(bounds.Width, duration);
            BoundsHeight.AnimateTo(bounds.Height, duration);

            Dimensions.Visibility = Visibility.Visible;
            Dimensions.Text       = string.Format(@"{0} x {1}", this.screenBounds.Width, this.screenBounds.Height);
        }