General

Reply

Level 1

Level 1
KITT1995
Posts: 10
Registered: ‎26-06-2012
Message 1 of 3 (84 Views)

Event on pagepanel change page

Hi,
Someone know a way to recreate a event that execute something when the user change page in pagepanel? Thanks in advance

Please use plain text.

Re: Event on pagepanel change page

Hi,

 

Thank you for your question. There is no delegate method in a PagePanel that you can use to know when the page has changed. To check if a PagePanel has changed pages, you could use the following snippet of code.

 

FlickGestureDetector gest = new FlickGestureDetector();
gest.Direction = FlickDirection.Horizontal;
gest.FlickDetected += delegate(object sender, FlickEventArgs e) {
	if(pagePanel.CurrentPageIndex != oldPageIndex)
	{
		Console.WriteLine("Looking at a new page");
		oldPageIndex = pagePanel.CurrentPageIndex;
	} 
};

pagePanel.AddGestureDetector(gest);

 I hope this helps you out.

 

James

 

PlayStation®Mobile Dev Team
Please use plain text.

Level 1

Level 1
KITT1995
Posts: 10
Registered: ‎26-06-2012
Message 3 of 3 (65 Views)

Re: Event on pagepanel change page

Thanks for your solution jamesnorman91, but I had already solved it by using a timer

Spoiler

 

System.Timers.Timer timer = new System.Timers.Timer();
			timer.Interval=100;
			timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
			timer.Start();

void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
		{
			if (PagePanel_1.CurrentPageIndex != old_page)
			{
current_page=PagePanel_1.CurrentPageIndex;
Console.WriteLine("Page changed");
old_page = current_page
}
}

 

Please use plain text.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。