-3

I have the following GUI design and the questions are in red.

enter image description here

Basically I have one Ribbon on top, and a main area below. The main area as you can see contains lots of panes. These are all floatable, dockable all that good stuff. I will use AvalonDock. So yeah my main questions are on the image, but they are more meant to start a conversation. I am sure you guys have done something similar and can share stuff related to this.

Just to be clear, I use visual studio 2012, c#, wpf, prism, and avalondock. Of course I try to organize things according to MVVM pattern.

user2381422
  • 5,645
  • 14
  • 42
  • 56
  • 3
    Please write your question out in the question, in text, not just in an image. It's easier to read, is searchable/indexable externally, can be more effectively edited, etc. – Servy Sep 20 '13 at 14:48
  • 1
    I used a prism region for each area and populated the region with a custom control deriving from content control and embedding the Avalon anchorable pane. But to get a view and view model inside the control, I used a factory. It seemed the cleanest, most robust way... – Gayot Fow Sep 20 '13 at 15:35
  • @GarryVass Can you give more details please? Do you have code to share? – user2381422 Sep 21 '13 at 17:33
  • The code itself is in the proprietary domain, but it's straight-forward to create a custom control that includes an anchorable pane in its visual tree. Attach views and view models to it as needed. Lots of code but conceptually very straight-forward – Gayot Fow Sep 21 '13 at 18:30

2 Answers2

1

Ribbon: It depends. Are you going to be adding and removing sections to the Ribbon? Both while running and from a development standpoint. If yes to either, then break apart the ribbon into View/ViewModels as appropriate. If no, then just make one View/ViewModel for the entire Ribbon region.

Yes, you want individual View/ViewModels for these sections. Can consider DockPanel as well for means to establish the components.

I would have a MenuRegion for the Ribbon, and Workspace region for below. In the Workspace View, I'd create the layout and assign each to its own Region which has the corresponding View/ViewModel.

bland
  • 1,968
  • 1
  • 15
  • 22
  • The ribbon will remain the same at runtime, but yes as the project evolves we will add new things to it. Hmm, so I can create nested regions? You said a workspace region, and then fill it with other regions. – user2381422 Sep 21 '13 at 17:36
  • @user2381422 Yes, you can do nested regions. – bland Sep 23 '13 at 11:38
0

Yes you are right about separate view for each region. If you are using a certain ribbon control say, from windows itself (System.Windows.Controls.Ribbon). Then the library provides you with different kind of button/ribbonbutton/dropdownbutton etc controls.

Now AvalonDock v2.0 is out, it has better support for MVVM pattern, it wasn't the case with v1.3.

Since you plan to use PRISM then you can use the region adaptor provided with it to host your views in their respective regions. You should be able to find plenty of samples for it. I tried to find one quickly for you from the AvalonDock project itself.

http://avalondock.codeplex.com/releases/view/92210

I hope it helps!

Rajiv
  • 1,426
  • 14
  • 21