How can I keep the AboutPrompt window show when navigated back?

Nov 6, 2011 at 9:43 AM

I have come across a problem when using popup window. In an application, I create a AboutPrompt window with a button on it. When I click the button, the application will navigate to another page. But when I navigate back, the popup window disappear. I am wondering how can I keep the popup window shown when I navigate back? Anyone can help? Thank you!

Nov 6, 2011 at 9:45 AM
        bool myPopupOpen = false;  
  
        protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)  
        {  
            if (myPopup != null)  
                myPopupOpen = myPopup.IsOpen;  
  
            base.OnNavigatingFrom(e);  
        }  
  
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)  
        {  
            if (myPopup != null)  
                myPopup.IsOpen = myPopupOpen;  
  
            base.OnNavigatedTo(e);  
        } 

I have learned that the common popup window can be set like this. But in the AboutPrompt, the "IsOpen" property is read-only.

Coordinator
Nov 8, 2011 at 9:59 PM

That would create a change on how the entire prompt class actually works along with the about prompt.  With About Prompt, You call Show() with params passed in and then additional work is done.  What you're asking is a fundimental change in how the base prompt class works.

One idea would be to have two bool HasBeginningAnimation and HasEndingAnimation so those story boards aren't fired off when show is executed.

Mar 25, 2012 at 2:19 PM

Did you solved this problem?

I have the same problem about the message prompt. link: http://coding4fun.codeplex.com/discussions/348100

Coordinator
Mar 25, 2012 at 4:02 PM

Yan, did you see my response to you in the other thread.  please create a repo so I can test fixes against it.  I don't see how you are navigating away from controls that take over the entire screen.

Mar 26, 2012 at 1:48 AM

Yeah, the about prompt will be destroyed when the page event OnNavigatedFrom() happens.

Mar 26, 2012 at 1:59 AM
crutkas wrote:

Yan, did you see my response to you in the other thread.  please create a repo so I can test fixes against it.  I don't see how you are navigating away from controls that take over the entire screen.

Sorry,my English is poor, I don't know how to create a repo? Thanks!

Coordinator
Mar 26, 2012 at 8:58 AM

I need a way to reproduce the issue. I need a test case basically. A repo is a very simple project that I can hook the debugger into that lets me see what you are experiencing,

I also for this need to know the use case as remembering this type of state, in my opinion, is your responsibility. The prompt is put on the visual tree of the page you told it to. Navigating away is an action you took, not the end user.  Navigating away destroys the visual tree, prompt with it.

The easy way to remember this type of state is to have an app level setting as well.

Mar 26, 2012 at 9:50 AM

Thanks!I'll try it again. Sorry for my poor English, 8-)