Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Basic design question for designing multi-screen guis

 
 
Old 04-17-2007   #1 (permalink)
rain73@gmail.com


 
 

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
Old 04-20-2007   #2 (permalink)
Plamen Ratchev


 
 

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
 

Thread Tools


Similar Threads
Thread Forum
OO design question .NET General
VS2005 Basic Hangs when changing from Code window to Design Window .NET General
Question on design involving some Generics .NET General
RTF Question: Is this a bug or by design? Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46