Hi all,
Here is the situation: I have a custom panel which has 2 different layout modes. The mode is switched by bool variable. The custom panel is a logical child of lets say some stackpanel:
Code Snippet
<StackPanel>
<CustomPanel Mode="True">
<Image>
<!-- The Image must contain CustomPanel "photo"rendered in another mode-->
</StackPanel>
Now what I need to do - to have somewhere other element - possibly Image, where I can render another mode of one single instance of my custom Panel. I need image only - it should not be a functional control.
I know I could use VisualBrush for that purpose but it always renders the same mode, at least I had no luck to make it rendering different modes.
Also I tried VisualTreeHelper.GetDrawing(Visual visual) but it's not that easy, becausethe result GrawingGroupdoes not contain VisualChildren's Drawings. Though I could make a recursive function which will get full DrawingGroup of my control if there is no other way to do what I need.
Any ideas?
Thanks
Anton