EmptyGlobalCategoryTitle - How can I change "File" to "Datei" in Workplace-Theme?

Apr 23, 2015 at 11:04 AM
Thank you very much for the answers of my two other questions. I think is is better to refactor my application so that it works fine with the Framework. The possibility to step through the code is fine - so i find some "standards" (naming, directory structure ...)

My firstlanguage is german - my application should be a "german" UI. How I can change the Value of the "EmptyGlobalCategoryTitle"-Property (I found them in the ActionGrid. They descripte the "Default name of the first Menugroup". I want it, that it called "Datei".

Thanks for your help
Michael
Coordinator
Apr 24, 2015 at 6:51 PM
Hello!

If you look at the default Workplace-Shell.xaml file (it's included in the source, but we also have it broken out in a separate download for easy access), it defines what the main shell window looks like. This includes that it uses a Ribbon, which is done through the ViewActionRibbon class. That class defines a EmptyGlobalCategoryTitle property, which defaults to "File".

To change it, you can copy the Workplace-Shell.xaml file into your local Themes/Workplace folder (or you can make an empty resource dictionary there and just copy that one style that contains the ribbon rather than the whole file, which also defines other styles). (Note: Make sure you link it from the local Workplace.xaml file so it loads iwth the theme). Whenever you copy a local style like that, it takes precedence over the one that is there by default.

So now, you can simply set the EmptyGlobalCategoryTitle in the ribbon element of your copy of the style (the property isn't set explicitly before since it is using its default, but you can just add it). And that should do the trick.


Markus

PS: Im Bedarfsfall koenntest du mir Fragen auch auf Deutsch schicken, aber ich hab jetzt auf Englisch geantwortet, so dass auch andere Mitleser die Antwort lesen koennen.
Apr 27, 2015 at 6:34 AM
Good morning

Thank you very much for the explanations.

I have try to change the sourcecode of the Workplace-Shell.xaml in the CODE.Framework.Wpf.Theme.Workplace-Project. If i set a value in the EmptyGlobalCategoryTitle then the UI dont show it.

Here my changes:
                       <mvvm:ViewActionRibbon x:Name="ribbon" Grid.Row="1" HorizontalAlignment="Stretch" Model="{Binding}"
                                               SelectedView="{Binding Path=SelectedItem, ElementName=OpenViews, Mode=OneWay}" 
                                               EmptyGlobalCategoryTitle ="Datei" />
If I open my application then the Global-Menu not shown anymore. If i remove the value then is shown the deault "File"-Menu. I hope you can see it

Thanks for your commen
Coordinator
Apr 30, 2015 at 7:34 AM
Hmmm.... I will have to take a look at that. I will let you know.

Markus
May 20, 2015 at 12:32 AM
FWIW, I can confirm the behavior. I created a CODE WPF and added a controller, model, and view. I added Workplace-Shell.xaml to the project, and added a line in Workplace.xaml to include the shell. Ran the project, everything runs as expected. After I add the parameter EmptyGlobalCategoryTitle to the ViewActionRibbon class, the "File" menu fails to show up at all. Shall I email the project so you can see what I've done, or at least the files I changed?
Coordinator
May 21, 2015 at 4:00 PM
It was a def. bug. It is fixed in the upcoming build.

Markus