private void InternalSetContent(UIElement content) { if (_rootVisual == null) { _rootBorder = new Border(); CoreServices.Instance.PutVisualRoot(_rootBorder); _rootVisual = CoreServices.Instance.MainRootVisual; if (_rootVisual == null) { throw new InvalidOperationException("The root visual could not be created."); } CoreWindow.SetInvalidateRender(_rootVisual.XamlRoot.QueueInvalidateRender); UIElement.LoadingRootElement(_rootVisual); Compositor.RootVisual = _rootVisual.Visual; _rootVisual?.XamlRoot.InvalidateMeasure(); UIElement.RootElementLoaded(_rootVisual); } if (_rootBorder != null) { _rootBorder.Child = _content = content; } }
public void Init() { Dispatcher = CoreDispatcher.Main; CoreWindow = new CoreWindow(); CoreWindow.SetInvalidateRender(QueueInvalidateRender); InitDragAndDrop(); }
public void Init() { Dispatcher = CoreDispatcher.Main; CoreWindow = CoreWindow.GetOrCreateForCurrentThread(); CoreWindow.SetInvalidateRender(QueueInvalidateRender); InitDragAndDrop(); }