且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Silverlight 中以编程方式检测 ScrollView 的结尾?

更新时间:2022-10-20 22:38:30

可能您想分别查看 Horizo​​ntalOffsetScrollableWidth 或 Vertical/Height.>

如果 Offset 等于 Scrollable 维度,那么您不想显示它...我个人还是会保留它,因为您的建议并不是真正的标准行为,这通常不是很好因为用户不期望它.

I am new to WPF and I am having some issues with this.

I have a ScrollView and a RepeatButton. I want to disable the RepeatButton programatically when the ScrollView has moved all the way left or all the way right. Is there an easy way to do this in Silverlight?

I found this page: http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrollchanged.aspx and was thinking of adding an event listener for this, but I don't know if that is the best way to tackle the problem.

Thanks guys! Please let me know if you need code samples or anything.

Probably you want to look at the HorizontalOffset and the ScrollableWidth or Vertical/Height respectively.

if the Offset is equal to the Scrollable dimension, then you don't want to display it... Personally I'd leave it though because what you're suggesting isn't really standard behavior, which is not usually good because the the user does not expect it.