WPF滚动查看器顶部的非滚动对象 [英] Non-scrolling object on top of a WPF scrollviewer

查看:78
本文介绍了WPF滚动查看器顶部的非滚动对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我正在使用一个带有滚动查看器的WPF应用程序.该滚动查看器示出了彼此相邻的多个矩形(对于项模板,一个对象称为主题").现在,我需要每个主题"名称. 浮动"在每一行的顶部,但它们必须停留在屏幕的左侧(如果我滚动,则不能移动).我尝试使用装饰器,但是效果不佳.我不能在屏幕左侧使用单独的栏,因为我在UI上浪费了太多空间.

所以问题是我需要每个主题的名称都位于其自己的矩形上方.该矩形必须滚动,但不必滚动其名称,因此它保持可见状态.我是否可以在itemtemplate本身内做任何事情(因为这是当前"主题名称的唯一已知位置),或者还有其他解决方案?

在此先感谢您(不好意思的英语).
Joachim

Hello

I'm working on a WPF application which has a scrollviewer. This scrollviewer shows multiple rectangles untherneath eachother (with an itemtemplate, one object is called a "theme"). Now I need the name of each "theme" 'floating' on top of each row but they have to stay on the left side of the screen (without moving if i scroll). I tried using an adorner but this didn't give a good result. I can't use a separate bar on the left on the screen, because I'd loose too much space on the UI.

So the problem is I need the name of each theme on top of its own rectangle. The rectangle has to scroll, but not its name so it stays visible. Is there anything I could do within the itemtemplate itself (because that's the only place the name of the 'current' theme is known), or maybe another solution?

Thanks in advance (excuse me for my bad English)
Joachim

推荐答案

能否请您显示一些代码解释一下吗?您如何在scrollerview中定义矩形?

Could you please show some code to explain it? How did you define the rectangle in scrollerview?


这篇关于WPF滚动查看器顶部的非滚动对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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