I wanted to know if I can get a portion of a canvas (or other panel) in WPF.
I have tried this in XAML:
<Rectangle Margin="1">
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=Grid1, Mode=OneWay}"/>
</Rectangle.Fill>
</Rectangle>
Wherein Grid1 is a Grid with 1 child control (a command button) But the rectangle displays the whole grid.
I wanted to get a portion of it, like this: Getting a portion of a Canvas (or grid) as visualBrush
On the image, a parent Grid (with pattern) holds a control (a textbox, button and a rectangle (or canvas or any panel)). The rectangle (shaded with transparent green as indicator only) should get the image (or a screenshot I don't know) behind it and assign the retrieved element to another rectangle as VisualBrush.
Hoping for your answer. Thanks.