问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/5809096/detect-end-of-scrollview-programatically-in-silverlight