如何从Scrolling for Wp7中停止ScrollViewer

时间:2011-02-09 02:09:39

标签: windows-phone-7

我有以下XAML:

< ScrollViewer Horizo​​ntalAlignment =“Left”Margin =“3,226,0,0”Name =“Scv”VerticalAlignment =“Top”ScrollViewer.Horizo​​ntalScrollBarVisibility =“Auto”ScrollViewer.VerticalScrollBarVisibility =“Auto”>

< Canvas Height =“100”Name =“canvas1”Width =“292”>

   Image Canvas.Left =“0”Canvas.Top =“0”Height =“440”Name =“image1”Stretch =“Fill”Width =“730”/>

     < InkPresenter Name =“inkPresenter1”>< / InkPresenter>

     < /画布>
< /&的ScrollViewer GT;

问题:如何在我将图像滚动到我想要的位置后停止ScrollViewer的滚动。

在上面的例子中,我使用scrollViewer将图像滚动到我想要停止的部分,以便我可以使用InkPresenter进行绘制。但无论何时我上下绘制,滚动查看器都会遵循InkPresenter上下移动的动作。

由于

1 个答案:

答案 0 :(得分:2)

检查此讨论: How to block scrolling in ScrollViewer

另一个选项可能是动态设置SetVerticalScrollBarVisibility do Disabled:

ScrollViewer.SetVerticalScrollBarVisibility(scrollViewer, ScrollBarVisibility.Disabled);