Answered by:
I need help with basic application design

Question
-
I'm still struggling with some basic concepts for architecting an LOB application. I have 20 tables (plus reports) that I need to manage data for.
In ASP .NET, I would have a MasterPage that contains common controls (page header, menu, etc.). Then I would have 20 .aspx pages (one per table), each with a GridView (to allow the user to filter and sort data), and a modal popup form for creating and editing records. To switch between screens, you simply load a new page to the web browser.
In WPF, I have a main window with a menu...
But now I'm not clear on the WPF way to create the table screens, and how to switch between them in the application. I'm finding lots of information on how to use WPF controls, but nothing on how to put it all together, especially for LOB applications.
Are you supposed to create a user control for each table or report and display them in the main window? If so, how do you manage switching between controls? Do you unload/load the controls as you need them? Or put all the controls on the main window and toggle their visibility?
Thanks in advance for helping me out.
-Duke
-DukeSaturday, March 26, 2011 5:43 PM
Answers
-
Duke,
There are MANY options in WPF for this. I'd recommend reading up on MVVM - it provides a clean way (via DataTemplates) to easily switch what is being presented, without having to have every "view" loaded up front (and hidden).
I good beginners resource on this is the series I wrote at: http://reedcopsey.com/series/windows-forms-to-mvvm/
-Reed
Reed Copsey, Jr. - http://reedcopsey.com
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Saturday, March 26, 2011 8:01 PM -
No,
Separate forms or pages are usually used.
Some people write mdi style applications for WPF. So there's one window which remains there all the time with a ribbon or toolbar. As the user chooses to do whatever, another window is loaded which is styled so it fills a panel in the main one.
Then there's the page based option. Here's an intro
Or
You can wrap a toolbar or ribbon into a context sensitive user control and use that throughout the application.
The latter is probably your most familiar option except for commanding which makes the context sensitive aspects paractical.
Or a hundred other options.
Hope this helps
- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Monday, March 28, 2011 8:01 AM -
Another thought.
Inheritance.
Probably something an asp.net dev wouldn't think of.
In windows forms you can have visual inheritance, in WPF you can't have visual inheritance BUT you can put common functionality in one form and inherit that.
http://weblogs.asp.net/psheriff/archive/2009/11/02/creating-a-base-window-class-in-wpf.aspx
- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Monday, March 28, 2011 8:58 AM
All replies
-
Duke,
There are MANY options in WPF for this. I'd recommend reading up on MVVM - it provides a clean way (via DataTemplates) to easily switch what is being presented, without having to have every "view" loaded up front (and hidden).
I good beginners resource on this is the series I wrote at: http://reedcopsey.com/series/windows-forms-to-mvvm/
-Reed
Reed Copsey, Jr. - http://reedcopsey.com
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Saturday, March 26, 2011 8:01 PM -
Hi Duke,
In addition to Reed's excellent series, you can also check out Josh Smith's article for more information about MVVM.
Min Zhu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Monday, March 28, 2011 3:37 AM -
No,
Separate forms or pages are usually used.
Some people write mdi style applications for WPF. So there's one window which remains there all the time with a ribbon or toolbar. As the user chooses to do whatever, another window is loaded which is styled so it fills a panel in the main one.
Then there's the page based option. Here's an intro
Or
You can wrap a toolbar or ribbon into a context sensitive user control and use that throughout the application.
The latter is probably your most familiar option except for commanding which makes the context sensitive aspects paractical.
Or a hundred other options.
Hope this helps
- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Monday, March 28, 2011 8:01 AM -
Another thought.
Inheritance.
Probably something an asp.net dev wouldn't think of.
In windows forms you can have visual inheritance, in WPF you can't have visual inheritance BUT you can put common functionality in one form and inherit that.
http://weblogs.asp.net/psheriff/archive/2009/11/02/creating-a-base-window-class-in-wpf.aspx
- Marked as answer by Min Zhu Thursday, March 31, 2011 2:18 AM
Monday, March 28, 2011 8:58 AM