Good. Therefore, I want my application to display the "Save" and "Save As ..." elements in its main menu, as Visual Studio does; that is, "Save {current file}" and "Save {current file} How ..."
I would also like to have regular access keys ("S" and "A" respectively).
I came up with two solutions, but not very desirable.
Instead of creating the main menu exclusively in xaml, I could create all of this in MainWindowViewModel so that I can fully control what happens to the created MenuItems. However, I believe that this would be a violation of MVVM (which I am trying to observe very strictly this time), since I would have to include links to each MenuItem icon in the ViewModel. Plus it seems a little dirty.
I can specify the title of only these two specific MenuItems (and possibly future ones) like this, but then I get a MenuItem that has not only an underscore in the title, but also does not contain an access key.
<MenuItem Header="{Binding CurrentFileName}" HeaderStringFormat="Save {0} _As...">
What should I do?
source share