예제 #1
0
        private void _InitializeWindowResizeBorderThickness()
        {
            var frameSize       = new Size(NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME), NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
            var frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize);

            WindowResizeBorderThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height, frameSizeInDips.Width, frameSizeInDips.Height);
        }
예제 #2
0
        private void _InitializeWindowResizeBorderThickness()
        {
            Size size    = new Size((double)Standard.NativeMethods.GetSystemMetrics(SM.CXFRAME), (double)Standard.NativeMethods.GetSystemMetrics(SM.CYFRAME));
            Size logical = DpiHelper.DeviceSizeToLogical(size);

            this.WindowResizeBorderThickness = new Thickness(logical.Width, logical.Height, logical.Width, logical.Height);
        }
예제 #3
0
        private void _InitializeWindowNonClientFrameThickness()
        {
            var frameSize           = new Size(NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME), NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
            var frameSizeInDips     = DpiHelper.DeviceSizeToLogical(frameSize);
            var captionHeight       = NativeMethods.GetSystemMetrics(SM.CYCAPTION);
            var captionHeightInDips = DpiHelper.DevicePixelsToLogical(new Point(0, captionHeight)).Y;

            WindowNonClientFrameThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height + captionHeightInDips, frameSizeInDips.Width, frameSizeInDips.Height);
        }
        private void _InitializeWindowNonClientFrameThickness()
        {
            Size   deviceSize    = new Size((double)NativeMethods.GetSystemMetrics(SM.CXFRAME), (double)NativeMethods.GetSystemMetrics(SM.CYFRAME));
            Size   size          = DpiHelper.DeviceSizeToLogical(deviceSize);
            int    systemMetrics = NativeMethods.GetSystemMetrics(SM.CYCAPTION);
            double y             = DpiHelper.DevicePixelsToLogical(new Point(0.0, (double)systemMetrics)).Y;

            this.WindowNonClientFrameThickness = new Thickness(size.Width, size.Height + y, size.Width, size.Height);
        }
예제 #5
0
        private void _InitializeWindowResizeBorderThickness()
        {
            Size frameSize = new Size(
                NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME),
                NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
            Size frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize, SystemParameters2.DpiX / 96.0, SystemParameters2.Dpi / 96.0);

            this.WindowResizeBorderThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height, frameSizeInDips.Width, frameSizeInDips.Height);
        }
예제 #6
0
        private void _InitializeWindowNonClientFrameThickness()
        {
            Size   logical       = DpiHelper.DeviceSizeToLogical(new Size((double)Standard.NativeMethods.GetSystemMetrics(SM.CXFRAME), (double)Standard.NativeMethods.GetSystemMetrics(SM.CYFRAME)));
            int    systemMetrics = Standard.NativeMethods.GetSystemMetrics(SM.CYCAPTION);
            Point  point         = DpiHelper.DevicePixelsToLogical(new Point(0, (double)systemMetrics));
            double y             = point.Y;

            this.WindowNonClientFrameThickness = new Thickness(logical.Width, logical.Height + y, logical.Width, logical.Height);
        }
예제 #7
0
        private void _InitializeWindowNonClientFrameThickness()
        {
            Size frameSize = new Size(
                NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME),
                NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME));
            Size   frameSizeInDips     = DpiHelper.DeviceSizeToLogical(frameSize, SystemParameters2.DpiX / 96.0, SystemParameters2.Dpi / 96.0);
            int    captionHeight       = NativeMethods.GetSystemMetrics(SM.CYCAPTION);
            double captionHeightInDips = DpiHelper.DevicePixelsToLogical(new Point(0, captionHeight), SystemParameters2.DpiX / 96.0, SystemParameters2.Dpi / 96.0).Y;

            WindowNonClientFrameThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height + captionHeightInDips, frameSizeInDips.Width, frameSizeInDips.Height);
        }