AdvancedLauncher.Tools.Interop.RedirectedHwndSourceHost.MeasureOverride C# (CSharp) Method

MeasureOverride() protected method

Determine the desired size of this element within the specified constraints.
protected MeasureOverride ( Size constraint ) : Size
constraint System.Windows.Size
return System.Windows.Size
        protected override Size MeasureOverride(Size constraint)
        {
            if (_hwndSource != null && _hwndSource.RootVisual != null) {
                HwndSourceHostRoot root = (HwndSourceHostRoot)_hwndSource.RootVisual;

                // We are a simple pass-through element.
                root.Measure(constraint);

                return root.DesiredSize;
            } else {
                // We don't have a child yet.
                return new Size();
            }
        }