Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Getting styled EplorerBarNavigationPaneHeader appearance
posted

I'm using an UltraExplorerBar (Style=OutlookNavigationPane), and I'm trying to retrieve the colors of the navigation pane header so I can style a related (non-Infragistics) component similarly. How do I do that, taking into consideration that UltraExplorerBar.GroupSettings.AppearancesLarge.NavigationPaneHeaderAppearance is set to default, and that the application may be styled with a style library from AppStylist?

From the answers in https://infragistics.com/community/forums/t/8760.aspx, it seems I should be looking for a UltraExplorerBar.ResolveNavigationPaneHeaderAppearance. Unfortunately, although the control does seem to have 4 different appearance resolve methods, that particular one does not seem to exist. Based on the answers in https://ko.infragistics.com/community/forums/t/22043.aspx, I have also looked for an internal method that I could call via reflection, but didn't find it. Am I looking for it the wrong place, or is there simply no way to do this?

As a workaround, I am trying to get the application style from the loaded .isl file. However, I haven't found any examples on how to do this (although the answers I referred to above does mention the possibility, they just say it's tricky and that I would have to duplicate the resolution process that the control uses). Also, the API documentation for StyleManager is not very helpful - e.g. http://help.infragistics.com/Help/Doc/WinForms/2016.1/CLR4.0/html/Infragistics4.Win.v16.1~Infragistics.Win.AppStyling.StyleManager~GetRole.html doesn't mention where to get ComponentRole from, or valid values for the roleName string. Is there any better documentation or guides somewhere?

Through guessing and trial-and-error, it seems that this does what I want to do (assuming the control is styled through application styling):

var appData = new AppearanceData();

var requestedProps = AppearancePropFlags.BackColor | AppearancePropFlags.BackColor2 | AppearancePropFlags.BackGradientStyle | AppearancePropFlags.ForeColor

StyleManager.Default.GetRole(new UltraExplorerBar().ComponentRole, "ExplorerBarNavigationPaneHeader").ResolveAppearance(ref appData, ref requestedProps, RoleState.Normal);

Can you confirm this is the right approach? And if not using the default styleset, the instead of using StyleManager,Default, then use StyleManager.FromName(styleSetName)?

  • 21795
    Offline posted

    Hello Steen,

    Please find below answers to your questions:

    gopceti said:

    var appData = new AppearanceData();
    var requestedProps = AppearancePropFlags.BackColor | AppearancePropFlags.BackColor2 | AppearancePropFlags.BackGradientStyle | AppearancePropFlags.ForeColor
    StyleManager.Default.GetRole(new UltraExplorerBar().ComponentRole, "ExplorerBarNavigationPaneHeader").ResolveAppearance(ref appData, ref requestedProps, RoleState.Normal);

    Can you confirm this is the right approach? And if not using the default styleset, the instead of using StyleManager,Default, then use StyleManager.FromName(styleSetName)?

    Yes, this is the correct way to get the resolved appearance of an Infragistics control. You should not use the Default style manager if any of your Infragistics controls do not style themselves via AppStyling, e.g. UseAppStyling is set to false.

    gopceti said:

    From the answers in https://infragistics.com/community/forums/t/8760.aspx, it seems I should be looking for a UltraExplorerBar.ResolveNavigationPaneHeaderAppearance. Unfortunately, although the control does seem to have 4 different appearance resolve methods, that particular one does not seem to exist. Based on the answers in https://ko.infragistics.com/community/forums/t/22043.aspx, I have also looked for an internal method that I could call via reflection, but didn't find it. Am I looking for it the wrong place, or is there simply no way to do this?

    You are correct. There is no such method to resolve the NavigationPaneHeaderAppearance. However, if you have set the appearance via AppStylist you can get it as you are doing it now. If not, please let me know so I can look further into this and try to find how you can resolve this appearance.