I have a control that I am converting to an image using the method here :
Force rendering of a WPF control in memory
Unfortunately I have a complex layout and it seems that a control being 'Collapsed' isn't actually being hidden properly in the output image.
Tried:
- Call
UpdateLayout
multiple times - Change size of control by 1 pixel
- Using a ViewBox
It seems to affect DockPanel if something is aligned to the bottom and hidden with a converter.
<DockPanel LastChildFill=True>
<Something Dock.Panel="Top" />
<Something Dock.Panel="Bottom" Binding="{Binding XXXXX, Converter={StaticResource booleanConverter}}"/>
<Something Dock.Panel="Bottom" Binding="{Binding YYYYY, Converter={StaticResource booleanConverter}}"/>
<Something />
</DockPanel>
Everything displays just fine in the Xaml editor, or if it is used at runtime in a real visible control.