How to keep the MessagePrompt status when navigated back?

Mar 10, 2012 at 1:24 PM

 I create a MessagePrompt window and it will be disappear after the OnNavigatedFrom Event. I want to keep the MessagePrompt status when navigate back. 

I solved this problem like this:


 

MessagePrompt winPrompt;
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
	if (this.winPrompt != null && this.winPrompt.IsOpen)
	{
		AppStateHelper.IsWinPromptOpen = true;                
	}
	else
	{
		AppStateHelper.IsWinPromptOpen = false;               
	}
}

 

I save the status of the MessagePrompt through PhoneApplicationService.Current.State, and override the OnNavigatedTo event:

 

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
	if (AppStateHelper.IsWinPromptOpen == true)
	{
		winPrompt = new MessagePrompt();
		winPrompt.Show();
	}
}

 

So, there is a new problem: when the MessagePrompt is show after navigate back, the ApplicationBar shows too. But  as a general rule the ApplicationBar is hidden when the popup is showing. So how can I control the  visible property of the ApplicationBar?

I try to set the visible property like this after winPrompt.Show(), like this:

if (AppStateHelper.IsWinPromptOpen == true)
	{
		winPrompt = new MessagePrompt();
		winPrompt.Show();
		this.ApplicationBar.IsVisible = false;
	}

But there is a error because the ApplicationBar is null now.

Thanks!

Coordinator
Mar 12, 2012 at 4:54 AM

create an issue with a repo please.

Mar 27, 2012 at 3:35 AM
crutkas wrote:

create an issue with a repo please.

I created a issue in the  Issue Tracker and upload a demo.

Could you help me with it? Thank you very much!