简体   繁体   中英

How to do non-linear page navigation in WPF & C#?

I'm not even sure if I'm using the right terms for what I'm trying to do. But basically I have a personal organizer program with content that changes depending on what task you're doing, a calendar vs. contact list vs. todo list etc.

My searches keep bringing up "Navigation" but I'm not sure that this is what I'm after, as I don't want to be stuck going forwards and backwards between pages. I want the user to be able to click on a link or button and be able to jump to any point in the program. Am I better off just removing all the controls and adding the new ones each time? I'd like to keep it all within one window if possible.

If I were in your situation, I would use tabs. Set up an individual tab for each each "task" (calender, contact list, todo list). This way users are one click away from any task they want to navigate to.

You want to use user controls. Each user control is like a sub-page of controls. Then you keep the same master page and just switch user controls based on what you want to show. You can put the user controls on separate tabs if you like or you can put them one after the other and make them visible/invisible or you can load them dynamically with code like

myBorder.Child = new MyUserControl(); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM