locked
Login Page UI and Navigation

    Question

  • Hi,

    I’ll get straight to the issue –

    I am looking to build a Windows 8 application using XAML/VB. 

    Simply on loading the application I want the user to be presented with a login screen and on successfully logging in (data stored on SQL database) the user will then be taken to the main page where they can start to use the application.

    Now I'm either over thinking this or haven’t thought it through enough…

    If I'm using pages to navigate between different parts of the application then once the user logs in, they are able to navigate backwards to the login page.  I could change the state of the login page so that the ‘login’ part isn't visible anymore (possibly replace it with the application’s logo) and just have a button to take them back to the main page but ideally I would want the login page to be essentially be ‘destroyed’ and therefore unable to navigate to.

    What is the best solution to creating a login page with Windows 8 applications?

    Thanks,

    Andy.

    Friday, January 18, 2013 9:16 AM

Answers

  • I would:

    - create a Blank App
    - add BasicPages in such a manner that all your Pages can inherit from LayoutAwarePage [see why hereafter]
    ---
    - create a first page [your App Welcome]
    - display it or not; if not, you navigate programmatically to the LogonPage
    - now, the NavigationCache contains 2 Pages
    - let the User perform the Logon; validate
    - use the LayoutAwarePage.GoHome method override to return back to the first page [your App Welcome]
    ---
    The LogonPage is gone.

    Private Sub HomeButton_Click_In_LogonPage(sender As Object, e As RoutedEventArgs)
    	MyBase.GoHome(sender, e)
    End Sub

    ---

    Note: Best to post XAML/VB language dependent questions in the VB/CSharp forum. Thank you.
     

    Friday, January 18, 2013 10:10 AM

All replies

  • I would:

    - create a Blank App
    - add BasicPages in such a manner that all your Pages can inherit from LayoutAwarePage [see why hereafter]
    ---
    - create a first page [your App Welcome]
    - display it or not; if not, you navigate programmatically to the LogonPage
    - now, the NavigationCache contains 2 Pages
    - let the User perform the Logon; validate
    - use the LayoutAwarePage.GoHome method override to return back to the first page [your App Welcome]
    ---
    The LogonPage is gone.

    Private Sub HomeButton_Click_In_LogonPage(sender As Object, e As RoutedEventArgs)
    	MyBase.GoHome(sender, e)
    End Sub

    ---

    Note: Best to post XAML/VB language dependent questions in the VB/CSharp forum. Thank you.
     

    Friday, January 18, 2013 10:10 AM
  • That sounds like a good way to work around it.  

    Thank-you very much indeed.

    Andy.

    Friday, January 18, 2013 11:17 AM
  • ... and in fact that's the standard way to 'clean up' the navigation stack from time to time - within your application logic - , in order to avoid it growing to 'inappropriate' sizes.
    Friday, January 18, 2013 11:24 AM