WPF Scale Transform and ScrollViewer - When Zoomed can't scroll beyond original size

核能气质少年 提交于 2019-12-22 16:58:07

问题


I have a StackPanel inside of a ScrollViewer.

I have a slider that does a scale transform on the stackpanel to allow zoom-in and zoom-out functionality. The problem is that when I zoom in, the scrollviewer doesn't treat the content as being 'bigger'.

So, if I scroll in a little and scroll as far right as I can go - it stops me before I get to the end of the content. If I zoom back out to the untransformed level, I see that it's stopping exactly at that point. If I zoom in a lot, I can only see a small fraction of my total content when I scroll all the way over.

I can change the TransformOrigin to control which side loses the most content; but I figure there should be some way for the scrollviewer (or another control?) to take care of it for me.


回答1:


Are you doing render transform, or layout transform? You should be doing the latter.



来源:https://stackoverflow.com/questions/1579167/wpf-scale-transform-and-scrollviewer-when-zoomed-cant-scroll-beyond-original

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