I have an app that uses WinExplorerBar, and we expose the ViewStyle enum via a drop-down menu so that the user can pick which style they want the Explorer Bar to have. This works great when I haven't loaded a style libarary. However, when I load up a custom style library (via StyleManager.Load("SomeStyleLibrary.isl")), all of the ViewStyles yield the exact same look for the explorer bar. How do I prevent this from happening?
I'm a little confused about your problem. Are you saying when you change the ViewStyle for the UltraExplorerBar you aren't seeing the ViewStyle change on the control, or are you saying when you change the ViewStyle for the UltraExplorerBar your UltraExplorerBar still has the same color's applied?
Sorry, let me re-explain. Scenario 1:
Scenario 2:
The only code differences between Scenarios 1 and 2 are limited to one line of code:
StyleManager.Load("MyStyleLibrary.isl");
In Scenario 1, this line is commented out. HTH.
I'm not seeing this using AppStylist to change the ViewStyle. I load an .isl file into AppStylist select the Navigation tab, and in the roles area I select UltraExplorerBar under Component Role Settings -> Infragistics Components. Once I do this at the bottom I see Common Component Properties, and I start toggling the ViewStyle and see the ExplorerBar on Canvas change.
If this isn't want you are seeing I would submit a support incident so that a Developer Support Engineering can investigate if there may be a bug in the version you are using.
I haven't mentioned AppStylist. If you want to reproduce, create a simple WinForms app, put an UltraExplorerBar on the main form, and expose the ViewStyle property via a drop-down list (i.e. populate the DDL with the ViewStyle's enum values and hook up an event handler to modify the ViewStyle property when the user makes a change to the selected item). This should work as expected, and you should see the UltraExplorerBar change visual appearance when you select. Now, load a style library before the Application.Run() call in Program.cs. Once you do this, the appearance of the UltraExplorerBar no longer changes when you change the selection in the DDL.
The thing is, I don't know if this is expected behavior. If so, how to I make the styles available and load a custom style library as well? If this not expected behavior, then I'll submit a support ticket.
An update: I've attached a proof-of-concept. Comment out the style library load in Program.cs as necessary to see the behavior change. I agree - in AppStylist, you can see the style of the UltraExplorerBar change; however, the style does NOT change once you've loaded the style library in the WinForms app.
Open the ISL and search for this line:
<styleSet name="Default" viewStyle="OfficeXp">
Remove the 'viewStyle="OfficeXp"' part of it. When you load an ISL it takes precedence over most of the visual aspects of the associated controls, the view style being one of them.
That did the trick, thanks.