ToolBarPanelRegionAdaptor doesn't apply toolbar styles to content items?

Dec 29, 2008 at 4:53 PM
Hi,

I am using the ToolBarPanelRegionAdaptor, but I'm finding it doesn't apply the correct style to separators (this may also be true of other controls just less obvious). I have tried both directly adding the separators in code and having them as part of a subset of controls in a stack panel, neither work.

The only way I have found to force the correct style to be used is to do the following:

            IRegion mainToolbarRegion = _regionManager.Regions[RegionNames.MainToolbarRegion];
            ToolBar temp = new ToolBar();
            Separator separator = new Separator
                                      {
                                          Style = ((Style) temp.FindResource(ToolBar.SeparatorStyleKey))
                                      };
            mainToolbarRegion.Add(separator);

This is obviously not ideal and not easily useable in all scenarios (e.g. the multiple controls in a horizontal stackpanel referred to earlier)

any thoughts welcome

cheers

Trev