I have two ToolBars side by side (I had to do that so I could align buttons right and left)
But now, I have to add some text that can be aligned right left or center between both toolbars. I added the text in a TextBlock inside a StackPanel disposed on a Grid at the second position (between the toolbars) and, of course, it created a gap between both toolbars (A stackPanel doesn't have the same style as a toolbar, of course).
I would like to replicate the toolbar LinearGradientBrush on my stackpanel so it looks the same as my toolbar does. the point is to make the thing look like ONE toolbar.
Is there a way to get the ToolBar Style or to recreate it with a LinearGradientBrush definition, and if so, how?
Here's one way you could do it. Say one of your toolbars' name is "toolBar." Bind the
Backgroundproperty on theStackPanelto theBackgroundproperty on theToolBaras such:Hope that helps! :)
EDIT:
You can check out the control template for the
ToolBarhere.The
LinearGradientBrushused looks as such:In the event you just wanted to use this instead of binding. :)