Kolja
Kolja

Reputation: 2377

WPF Application Layout

Currently we are designing a new configuration front-end for our application. In order to have the application running as a XBAP in the browser we don't want to use modal dialogs. I don't want discus the user interface design itself but i would like to ask some technical question if our approach is good from the technical side. Most of use are new to WPF in detail but we are familiar with the MVVM pattern and one of our main goals is to separate the most code out of the GUI and mainly use xmal for UI definition.

Ok now to our sketch.

The "Mainmenue": should be some Outlook like treeview to select the configuration section the user wants to edit

The "Context depending Menue": should a Menue depending on the the Item selected in the "Mainmenue" e.g. a ribbon bar. That provides functions like "add new entry" "or remove entry" But also having a Application wide function like "load config file"

The "Context": should be the Data behind the entry selected in the "Mainmenue" e.g. a grid of the config entries in the selected category.

Ok actual concept was having a page split into two frames and having one "Mainmenue" page loaded into the left and a second on loaded to the right. The right one is exchanged when the user selects something in the menue. But not it is a pain to make new context view as we can't inherit from xaml ui difinitions. I tried the workaround described here 2 but that doesn't very well. And we don't want to define our UI in C# that would be another workaround for the problem.

Now we created a new sketch in order to refactor our layout. Now we want to split the main page into three frames one for the "mainmenue" one for the "context" and one for the "context depending menue". In fact the every context view has its own ViewModel we thought about having each Viewmodel a property like "menue entries" and binding this to the "context depending menue" that should display the menue for the context. And having the application wide function programmed only once.

Now may question is do you see any downside of this approach? I know some things will be a bit tricky with Databinding.

WPF Application Layout scetch

Upvotes: 2

Views: 386

Answers (1)

ashley aberneithy
ashley aberneithy

Reputation: 520

I think that the major problem that comes across reading your question is that it seems very much like the implementation details are driving the UI design, which is the wrong way round.

Personally I think that you should sit down with some of your users and show them a few screen mock ups. I've worked on user interface design for a few years now and I can tell you that you can save a massive amount of time by showing a concept to your users before even thinking about implementation. Also it might be worth conducting a small UX study to see how frequently each part of your UI will be used. For example does the MainMenue have to be constantly present on the screen? Can it be pinned to the right hand side and only be displayed when the user hovers over it?

In terms of modelling your ViewModels remember that your ViewModels can contain nested ViewModels and each ViewModel should have a single responsibility (following the Single Responsiblty Principle) for example, perhaps each record in your grid is bound to it's own instance of a GridRecordViewModel, and the GridRecordViewModel are contained within an ObservableCollection in the AllGridRecordsViewModel.

Upvotes: 1

Related Questions