Ejemplo n.º 1
0
        internal static void CenterWindow(Window wnd, UIApplication uiApp)
        {
            var centerRect = uiApp.CenterRectangleOnExtents(wnd.Width, wnd.Height);

            // setting location on the Eto window causes window to be placed at the wrong location
            // or high-dpi screens, because Eto is using a newer dpi detection mechanism
            // and the fact that Revit does not support per-monitor dpi
            // setting location on the Wpf window instead
            wnd.ToNative().WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            wnd.ToNative().Left = centerRect.Left;
            wnd.ToNative().Top  = centerRect.Top;
        }