Windows Vista Forums

Basic design question for designing multi-screen guis

  1. #1


    rain73@gmail.com Guest

    Basic design question for designing multi-screen guis

    I'm working on a simple game in WPF. Here is my problem: I want to
    have a login where the user goes through a series of screens to login.
    In Java, I've implemented this kind of thing by defining a panel to
    hold the login screens. Then when the user advances to the next
    screen, the currently displayed panel is removed from the parent panel
    and the new panel is added.

    I'm confused about how to replicate this behavior in WPF while taking
    advantage of XAML. If I were to make my WPF completely code based with
    no xaml, I could use the same technique that I used in Java (each
    screen would be a class that extends a panel such as StackPanel). But
    as far as I can tell, if I make a XAML/Code class in WPF, it has to be
    either a window or a page. I can't make a XAML file with <StackPanel>
    or some other panel as the root element.

    I've read a bit about the Frame element but I'm not sure if this is
    the right approach to take (hosting each login screen inside the frame
    and advancing to the next "page").

    Any ideas? I'm clearly just missing some key idea on how WPF works.
    I've been thinking about this problem and reading documentation for
    countless hours and so any help you could provie would be greatly
    appreciated. Thanks!


      My System SpecsSystem Spec

  2. #2


    Plamen Ratchev Guest

    Re: Basic design question for designing multi-screen guis

    One way to implement what you need would be to use a Frame and then load
    XAML defined pages (just set the source for the Frame to the next page). The
    Frame will be just one of the elements in your window, you can have
    StackPanel and other content there too (and you can use Grid, StackPanel,
    etc. to arrange the Frame position).

    Another way is to use a NavigationWindow for container and add Pages. Then
    you can use the NavigationService to move between page. This can provide you
    a little bit extra power as the NavigationService works similar to your
    browser. It can go back and forward between pages (with GoBack or GoForward,
    or directly Navigate).

    HTH,

    Plamen Ratchev
    http://www.SQLStudio.com



      My System SpecsSystem Spec

Basic design question for designing multi-screen guis

Similar Threads
Thread Forum
vb.net design question on version updates
Hi, need some design advise. Looking at converting an Access Project into vb.net but the project undergoes some regular enhancements according...
.NET General
OO design question
Hi! I am designing a 3-layer architecture and have run into a design issue where I would like som input on best practise. Today I have a...
.NET General
VS2005 Basic Hangs when changing from Code window to Design Window
When I change from the code view to the design view of a form in Visual Studio 2005 (VB.NET) The design environment hangs for up to five minutes...
.NET General
Question on design involving some Generics
Hi, It's been a while. I am a bit stuck on deciding on how this should be done. I need to retrieve orders and their order items and pass the result...
.NET General
Multi-boot question
I curently have Vista x64 set up on RAID 0 one set of hard drives and XP Pro on another set of drives. While trying to set up my computer with a...
Vista installation & setup
RTF Question: Is this a bug or by design?
In Vista, customize your visual Theme to use a "classic appearance" and select "High Contrast Black". Open WordPad (which uses an RTF...
Vista General
Schema Design Question
Ok, I'm stumped here. Suppose I have a schema consisting of publishers and books. Each book is published by one and only one publisher. So in the...
WinFS