gst*_*ken 33
是的,ListBox的默认行为(或者更确切地说,默认ListBox模板中的ScrollViewer)很奇怪 - 当我第一次遇到它时,我认为它一定是一个恶作剧.事实上,很难找到任何关于它的文档 - 但这里简要提到:
ManipulationBoundaryFeedback事件使应用程序或组件能够在对象到达边界时提供视觉反馈.例如,Window类处理ManipulationBoundaryFeedback事件,以使窗口在遇到其边缘时略微移动.
因此,解决它的方法是在ListBox上处理ManipulationBoundaryFeedback,并将Handled设置为true:
<ListBox ManipulationBoundaryFeedback="OnManipulationBoundaryFeedback">
// ...
</ListBox>
Run Code Online (Sandbox Code Playgroud)
代码隐藏:
private void OnManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
{
e.Handled = true;
}
Run Code Online (Sandbox Code Playgroud)