Include Adorner in ScrollViewer scrollable region

笑着哭i 提交于 2019-12-10 17:48:15

问题


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.

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


回答1:


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.



来源:https://stackoverflow.com/questions/10065130/include-adorner-in-scrollviewer-scrollable-region

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!