2012-12-12 1 views
3

내가 함께 페이지가 다른 제스처 터치로 스크롤 및 처리 그리드와의 ScrollViewer는 :ScrollViewer에 지하철 응용 프로그램에서 -

<Grid x:name="mainGrid"> 
    ... 
    <ScrollViewer Name="mainScroller" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollMode="Enabled"> 
    ... 
    </ScrollViewer> 
    ... 
</Grid> 

나는 수직 터치 이동 (손가락으로 이동)에 대한 처리 동작을 싶지만 보존하려는 수평 터치로 mainScroller 콘텐츠를 스크롤해도 움직입니다.

나는 mainGrid 참고 : ManipulationCompleted = "Grid_ManipulationCompleted"를 추가했습니다 :

private void Grid_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) 
{ 
    if (e.Cumulative.Translation.Y < -50 && e.Velocities.Linear.Y<1000) 
    { 
    ...make some action... 
    } 
} 

최종 효과가 나는 mainGrid에 대한 ManipulationMode = "translate Y를"를 사용하는 경우, 다음 수직 터치 이동이 작동한다는 것입니다 만, 수평 스크롤하지, 그리고 사용하지 않을 때는 가로 스크롤이 가능하지만 세로 터치는 움직이지 않습니다. 이 기능을 모두 기능화 할 수 있습니까? 영어로 죄송합니다.

+2

@johnwiese 수석 기술 전도사
[email protected]
왜 ManipulationMode에 '전체'.. 내가 노력 – Tirumudi

+0

을 설정하지,하지만 동일합니다. mainGrid에만 ManipulationMode를 추가하면 스크롤 할 수 있지만 manipulation 이벤트는 scrollViewer에서만 발생합니다. mainScroller 나 children 요소에 ManipulationMode를 추가하면 스크롤 할 수 없습니다. – user1897730

답변

0

시나리오를 이해하는 데 도움이 될 수 있지만 일반적으로 사용자가 제안한 것처럼 내장 제스처와 충돌 할 수있는 새로운 동작을 생성해서는 안됩니다.

존 위즈
마이크로 소프트 -