I am adding a LayerVisual to a Panel by invoking
LayerVisual layerVisual; // this is created using a Compositor in previous logic
Panel parent; // I get this Panel from my XAML
ElementCompositionPreview.SetElementChildVisual(parent, layerVisual);
Unfortunately using ElementCompositionPreview.SetElementChildVisual() I have two problems:
- I can set only one
LayerVisualat a time - such
LayerVisualis placed on top of all the other elements (and I want instead it in the background)
Therefore, I would be happy to have a solution like
parent.Children.Insert(0, layerVisual);
but unfortunately the layerVisual is not an UIElement.
How can I achieve this result?