최근에 Windows Phone 8 용 앱을 다시 작성했지만 새 Silverlight Toolkit을 사용하면 GestureListener가 더 이상 존재하지 않습니다. "GestureListener는 Silverlight 프로젝트에서 지원되지 않습니다." 정말 내 애플 리케이션에 제스처 네비게이션 시스템을 구현하는 페이지를 왼쪽 또는 오른쪽으로 두 개의 다른 페이지 중 하나를 탐색 할 수 있지만 특정 "끌기 임계 값"후 - 이것은 WP7에 멋지게 표시했다 here (동작 내 MainPage에 적용하고 싶은 항목을 삭제하기 위해) -하지만 오래된 컨트롤이 없으면 끊임없이 노력한 후에이 작업을 수행 할 명확한 방법을 볼 수 없습니다. 이제 우리가 사용할 수있는 것은 세 개뿐입니다. 이전에는 훨씬 더 쉬워 진 프로세스가 복잡했습니다. 나는 전체 페이지 (즉, 첫 번째 ContentPanel)를 가로 방향으로 움직일 수 있도록 만들려고 노력하고 있지만, 지금은 이것을 달성 할 수 없다. 누군가 제발 도와 줄 수 있습니까?WP8이 이전 WP7 툴킷없이 동작 구현
1
A
답변
3
using Microsoft.Phone.Controls;
namespace PhoneApp2
{
public partial class MainPage : PhoneApplicationPage
{
double _x = 0;
double _y = 0;
double _x2 = 0;
double _y2 = 0;
public MainPage()
{
InitializeComponent();
}
private void PhoneApplicationPage_ManipulationStarted_1(object sender, System.Windows.Input.ManipulationStartedEventArgs e)
{
_x = e.ManipulationOrigin.X;
_y = e.ManipulationOrigin.Y;
}
private void PhoneApplicationPage_ManipulationCompleted_1(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
{
_x2 = e.ManipulationOrigin.X;
_y2 = e.ManipulationOrigin.Y;
string _xx = string.Format(" x:{0} y:{1} x2:{2} y2:{3}", _x, _y, _x2, _y2);
if (_y > _y2 && _y - _y2 > 100)
{
lbl1.Text = "up" + _xx;
}
else if (_x > _x2 && _x - _x2 > 100)
{
lbl1.Text = "left" + _xx;
}
else if (_y < _y2 && _y2 - _y > 100)
{
lbl1.Text = "down" + _xx;
}
else if (_x < _x2 && _x2 - _x > 100)
{
lbl1.Text = "right" + _xx;
}
}
}
}
코드 만 대답하는 것은 일반적으로 환영받지 못합니다. 설명 좀 해 주실 수 있습니까? 자세한 내용은 [답변 방법] (http://stackoverflow.com/questions/how-to-answer)을 참조하십시오. – Jesse