2010-12-15 66 views
4

我們有一個運行在Win 7上的WPF應用程序。在Win 7中使用觸摸手勢時,滾動ListView時,應用程序在列表的末尾「聳聳肩」到達了。Windows 7觸摸屏「聳聳肩」

這也可以在Internet Explorer中複製。如果您加載足夠長的網頁以生成滾動條,則Windows會在觸摸手勢滾動時到達頁面底部時「聳聳肩」IE。

有沒有辦法在Windows中關閉聳肩或以某種方式使用我的WPF應用程序中的代碼禁用它?我需要保持聯繫,關掉聳肩。

+0

另外我要補充,我認爲它不僅會在應用程序是全屏。 – 2010-12-15 16:06:10

+1

這稱爲[「邊界反饋」](http://msdn.microsoft.com/en-us/library/dd371416.aspx),您應該可以將其關閉以用於您自己的窗口。不確定系統範圍。 – 2011-07-05 04:36:46

回答

4

手柄的ManipulationBoundaryFeedback(即e.Handled = true)。

3

如果要禁用窗口中所有控件的邊界,則應該將ManipulationBoundaryFeedback控制柄放置在窗口的第一個面板上,而不是窗口本身上。

不起作用:

<Window x:Class="TestControls.BoundaryFeedback" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     ManipulationBoundaryFeedback="Control_ManipulationBoundaryFeedback" 
     > 
</Window> 

作品:

<Window x:Class="TestControls.BoundaryFeedback" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     > 
    <Grid ManipulationBoundaryFeedback="Control_ManipulationBoundaryFeedback"> 
    </Grid> 
</Window> 

在後面的代碼:

private void Control_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) 
{ 
    e.Handled = true; 
} 
+1

太棒了!我長期以來一直在努力解決這個問題。真的不清楚在Window上處理這個是行不通的。 – Jens 2015-02-11 09:33:07