开发者

Forcing Arrange in a Custom WPF Canvas

I'm working on a project that involves creating a custom graphical editor. The graphical editor has multiple tabs, and I want to create a preview function that will show a popup with Bitmap previews of the content of each of the tabs. However, the problem I'm running into is that the content for each of the tabs must be arranged before a proper pre开发者_如何学Goview can be generated for it. This means going into each of the tabs to ensure that they're rendered and arranged. Then, and only then, do the previews get properly generated, otherwise the previews have a size of 0x0. Does anybody know how to force an arrange of a content control so that I can get a properly sized preview generated ?


Apparently you can just call the 'Arrange' method directly, but you have to be careful about the rectangle you pass in as a parameter, because it can adversely affect the display of your control if you just want to force the object to draw itself (ie can force it to draw out of the desired position).


Here is a link to MSDN where it discusses the "arrangeOverride" method of a control.

I'm not sure this is what you need, but this method seems to be what you're asking about.

Hope this helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜