0

I'm starting a new application for editing files, but I'm not sure how to implement the main menu bar in an MVVM way. It makes sense to create a separate MenuView which is composed into my ShellView, but then how do I wire it up to my DocumentView?

My first thought was to use an event aggregator, but it seems like there would be too many events flying back and forth once you have menu items that need to be enabled/disabled based on context (e.g. copy and paste).

For what it's worth, I'm using Caliburn.Micro as my MVVM framework.

Neil
  • 249
  • 3
  • 13
  • Are you talking purely about the XAML portion of it, or handling the code that runs when a `MenuItem` is selected? – Bradley Uffner Aug 03 '17 at 15:46
  • Mostly the code to wire the `MenuItem`s to my `DocumentView`. Although to be honest, I'm starting to wonder if my views should actually be pushing their own `MenuItem`s into `MenuView` somehow... – Neil Aug 03 '17 at 16:19
  • Does [this SO answer](https://stackoverflow.com/a/23941998/4265041) help? – Steven Rands Aug 04 '17 at 08:42

1 Answers1

1

Maybe try ready control for this purposes:

https://github.com/fluentribbon/Fluent.Ribbon

There is a showcase, and you can download it and see how are things done there.

Piotr
  • 1,155
  • 12
  • 29
  • My question was how to create and wire up a conventional `Menu` using proper MVVM design practices. This isn't an answer, it's a link to a third party control designed to mimic Microsoft Office. – Neil Aug 03 '17 at 19:54
  • The sample application under the `Fluent.Ribbon.Showcase` folder looks like it implements what you're after. – Jack Hughes Aug 11 '17 at 08:34