AdvancedLauncher.Tools.Interop.RedirectedHwndSourceHost.SetRootVisual C# (CSharp) Méthode

SetRootVisual() private méthode

private SetRootVisual ( object arg ) : object
arg object
Résultat object
        private object SetRootVisual(object arg)
        {
            Debug.Assert(_hwndSource != null);

            FrameworkElement child = arg as FrameworkElement;
            if (child == null && arg is Uri) {
                child = (FrameworkElement)Application.LoadComponent((Uri)arg);
            }

            HwndSourceHostRoot root = (HwndSourceHostRoot)_hwndSource.RootVisual;
            root.Child = child;

            // Invalidate measure on this HwndHost so that we can remeasure
            // ourselves to our content.
            InvalidateMeasure();

            return null;
        }