【发布时间】:2017-02-01 04:18:08
【问题描述】:
我有一个控件,我正在使用此处的方法将其转换为图像:
Force rendering of a WPF control in memory
不幸的是,我有一个复杂的布局,并且似乎正在“折叠”的控件实际上并未正确隐藏在输出图像中。
试过了:
- 多次拨打
UpdateLayout - 将控件大小更改 1 个像素
- 使用 ViewBox
如果某些东西与底部对齐并用转换器隐藏,它似乎会影响 DockPanel。
<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>
一切都在 Xaml 编辑器中显示得很好,或者如果它在运行时在真正可见的控件中使用。
【问题讨论】:
标签: wpf wpf-controls