I have WPF WrapPanel, and a toolbar inside. The WrapPanel is red and the toolbar is blue.

Could anybody explain me, where did indent of WrapPanel on the top, left etc. come from, and how I can remove it?
Here is the sample code of the image:
<WrapPanel Orientation="Horizontal" Background="Red">
<ToolBar x:Name="tFirst" Background="Blue" ToolBarTray.IsLocked="True">
<Button ToolTip="New" Content="New" />
<Button ToolTip="Save" Content="Save" />
<Button ToolTip="Delete" Content="Delete" />
</ToolBar>
</WrapPanel>
Thanks in advance.
UPDATE: the problem is only with Toolbar, I just changed WrapPanel to DockPanel, and the problem is still exists.
It’s probably something about the default, built-in control template of the
ToolBarcontrol.A quick fix is, obviously, to set
Marginto -2 for example.ToolBaris internally quite complex, it consists of aGrid, aBorder, aDockPaneletc. you can try and traverse it withVisualTreeHelper. For example:retrieves the
DockPanelobject. You can try and find the control withMarginorPaddinggreater than 0, and if you succeed you could probably even reset it from code (something like:(dockPanel as DockPanel).Margin = 0;)In XAML, I’d try overriding
ToolBar'scontrol template (as demonstrated in http://msdn.microsoft.com/en-us/library/aa970772(v=vs.85).aspx – although this example is of course overly complex for your purpose, the principle is the same).