SilverFlow.Controls.FloatingWindow.MoveWindow C# (CSharp) Method

MoveWindow() private method

Moves the window to the specified coordinates.
private MoveWindow ( Point point ) : void
point Point Coordinates of the window.
return void
        private void MoveWindow(Point point)
        {
            if (contentRoot != null && !point.IsNotSet())
            {
                // Round coordinates to avoid blured window
                double x = Math.Round(Math.Max(0, point.X));
                double y = Math.Round(Math.Max(0, point.Y));

                var transformGroup = (contentRoot.RenderTransform as TransformGroup).Clone();
                var translateTransform = transformGroup.Children.OfType<TranslateTransform>().FirstOrDefault();
                translateTransform.X = x;
                translateTransform.Y = y;

                contentRoot.RenderTransform = transformGroup;

                Point newPosition = new Point(x, y);

                if (Position != newPosition)
                    Position = newPosition;
            }
        }
FloatingWindow