Ejemplo n.º 1
0
 public void Move(double deviceLeft, double deviceTop)
 {
     if (this.hwndSource == null)
     {
         return;
     }
     NativeMethodsUltimate.SetWindowPos(this.hwndSource.Handle, IntPtr.Zero, (int)deviceLeft, (int)deviceTop, 0, 0, 85);
 }
Ejemplo n.º 2
0
        public void Show(UIElement parentElement)
        {
            HwndSource hwndSource = PresentationSource.FromVisual((Visual)parentElement) as HwndSource;

            this.EnsureWindow(hwndSource == null ? IntPtr.Zero : hwndSource.Handle);
            Point screen      = parentElement.PointToScreen(new Point(0.0, 0.0));
            Size  deviceUnits = parentElement.RenderSize.LogicalToDeviceUnits();

            NativeMethodsUltimate.SetWindowPos(this.hwndSource.Handle, IntPtr.Zero, (int)screen.X, (int)screen.Y, (int)deviceUnits.Width, (int)deviceUnits.Height, 84);
        }