Dear all,
I have an application that allows the user to change the style of the application. For reasons that I won't go in to this is the way the end user wants it, and when where possible they want the Office 2010 look to the application menu. Some styles support an Office 2010 application menu and others don't. So I've designed both.
The problem I'm having is detecting when the new style supports an 2010 application menu so that I can change the ribbon FileMenuStyle accordingly i.e. what goes in the if clause:
if (<Detect support for ApplicationMenu2010>)
ultraToolbarsManager1.Ribbon.FileMenuStyle = FileMenuStyle.ApplicationMenu2010;
else
ultraToolbarsManager1.Ribbon.FileMenuStyle = FileMenuStyle.ApplicationMenu;
I'm sure this is a simple thing that I am just missing/overlooking.
Regards and thanks.
Hello B_D,
I`m not sure that I understand your question. What do you mean with "Some styles support an Office 2010 application menu and others don't". Which styles do your refer. Are you talking about AppStyle ?
Please explain more deeply.
Thanks and Regards
The style I'm referring to are the style files loaded via Infragistics.Win.AppStyling.StyleManager.Load
Our application by default has a File tab which is how you access the application menu. I understand this accessing of the application menu via a 'tab' is the ApplicationMenu2010 FileMenuStyle. However, we allow users to change software styles i.e. to call the above method. Certain style change the application menu from a 'tab' to a circular button, in such cases the FileMenuStyle should be ApplicationMenu. The visual difference is the ApplicationMenu2010 takes up the entire application, whereas the ApplicationMenu acts more like a popup.
The problem is, Infragistics does not automatically change the FileMenuStyle. I realise this is a simple thing to change in code, but what I am missing is the bit that tells you whether a style has the application menu as a button or a 'tab'.
You could try to get the values from your appStyle using ComponentStyleSettingsCollection. By this way you could check the values of each property from your AppStyle. For example:
ApplicationStyleLibrary styleLibrary = new ApplicationStyleLibrary();
styleLibrary.LoadFromStyleManager();
StyleSetSettings styleSet = null;
if (styleLibrary.StyleSets.Count > 0 && styleLibrary.DefaultStyleSet != null)
styleSet = styleLibrary.StyleSets[styleLibrary.DefaultStyleSet];
if (styleSet == null)
{
styleSet = styleLibrary.StyleSets.Add("Default");
styleLibrary.DefaultStyleSet = styleSet.Key;
}
By this way your could check Component style using : styleSet.ComponentStyles, or RoleStyle : styleSet.RoleStyles and so on.
Let me know if you have any questions .
Regards
I realise this Georgi, but it doesn't answer my query...
Is there a way to detect which application menu setting should be used for a given style. Then I can programmatically do what Infragistics doesn't
B_D said: The problem is, Infragistics does not automatically change the FileMenuStyle
The mentioned behavior is expected. The appStyle change only the look and feel of your controls. You should take a care for the changes in your UltraToolbarManager.
Please let me know if you have any questions.