在ScrollViewer可滚动区域中包括Adorner [英] Include Adorner in ScrollViewer scrollable region

查看:77
本文介绍了在ScrollViewer可滚动区域中包括Adorner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在 ScrollViewer 中有一个 Adorner 。滚动查看器底部的对象有时可以在其下方显示一个大装饰物。不幸的是,该装饰器未包含在滚动查看器的 ExtentHeight 中,因此装饰器的下部被滚动查看器视口的底部限制。

I currently have an Adorner inside a ScrollViewer. Objects at the bottom of the scrollviewer can sometimes display a large adorner below them. Unfortunately, that adorner is not included in the ExtentHeight of the scrollviewer, so the lower portion of the adorner is clipped by the bottom of the scrollviewer's viewport.

有没有办法将装饰图层的内容包含在scrollviewer的可滚动区域中?

Is there a way to get the adorner layer's contents to be included in the scrollable region of the scrollviewer?

推荐答案

恐怕来自其他来源和调查时间的共识似乎是我所说的根本不可能。我的解决方案只是检测出ListBox中的最后一项,并在显示我的Adorner时自动在其底部添加一个边距。这有点骇人听闻,但可以达到上述预期的行为。

I'm afraid the consensus from other sources and hours of investigation seems to be that what I mentioned simply isn't possible. My solution has been simply to detect the last item in my ListBox and automatically add a margin to its bottom when my Adorner is being displayed. It's a bit of a hack, but it achieves the desired behavior mentioned above.

这篇关于在ScrollViewer可滚动区域中包括Adorner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆