I am writing a C# form based application and was wondering how the screen hierarchy is laid out and what components are used.
The application flow is very much like a mobile app structure with one main window and from this you may drill down into different ‘screen-stacks’.
What is the best way of doing this is C#?
Do I use different forms or is form the base screen, and then only replace panels?
I would not use different forms or panels as it will most likely turn the code into a big unmaintanable ball of mud.
Instead you could look at using UserControls and dynamically load whichever is the most appropriate. This solution will work with a small number of controls however will get out of hand when there are many events, complex logic and maintaining state and I wouldn’t imagine it would be that useful for anything other than small projects.
In 2005 the Patterns & Practices group implement the Composite UI Application Block as a first attempt at improving dynamically loaded user controls. However this was largely abandoned after the release of .NET 3 with Prisim. In November 2010 Prisim 4.0 was released in an effort to be more of an RIA a style architecture. Personally I would go with the Prisim approach as there is a good community, support from Microsoft and a lot of hard work has gone into the project to overcome the issues which you will undoubtably encounter.