Esempio n. 1
0
        internal static async Task Render(CompositionEngine compositionEngine, SharpDX.Direct2D1.RenderTarget renderTarget, FrameworkElement rootElement, Border border)
        {
            var rect  = border.GetBoundingRect(rootElement).ToSharpDX();
            var brush = await border.Background.ToSharpDX(renderTarget, rect);

            if (brush != null)
            {
                var geometry = GetBorderFillGeometry(compositionEngine, border, rect);

                var layer = border.CreateAndPushLayerIfNecessary(renderTarget, rootElement);

                renderTarget.FillGeometry(geometry, brush);

                if (layer != null)
                {
                    renderTarget.PopLayer();
                    layer.Dispose();
                }
            }

            await compositionEngine.RenderChildren(renderTarget, rootElement, border);
        }