![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| 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 | |||