Frage

im developin an app for wp7 that it holds pictures and notes with password login. But when app running if user press windows button app is running at background and if user press back button it resumes without asking password again.

i tried to Navigate when app activated but i couldnt manage it in Application_Activated method. is there a way to do that? Or could you advice me sth else that solve my problem.

ty.

here is my code im using to navigate,

(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
War es hilfreich?

Lösung

I got around this issue by using UserControls on the MainPage, showing one if the user had not yet logged in and the other if they had, I set these controls up to show/hide based on certains states in the MainPage and then bind that to the MainViewModel:

        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
                // Ensure that application state is restored appropriately
                ....your code here to load stuff...

                App.ViewModel.MainPageState = "ShowThemTheLogin";
            }            
        }
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top