菜单和 window 之间的白色 space

White space between menu and window

在 xaml window 中使用 menu 控件,我在 window 边框和对接面板之间有这个烦人的白色 space。

菜单本身位于堆栈面板内:

   <Window x:Class="COZView.Shell" 
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sc="clr-namespace:COZView.StaticContent"
    xmlns:ve="clr-namespace:COZView.View_Edit"
    Title="COZView" Width="1024" Height="800" Icon="/COZView;component/Images/COZView.png" 
    Loaded="OnLoaded" IsVisibleChanged="isVisibleChanged" Closing="OnClosing">

<Grid x:Name="ShellRegion">
    <StackPanel Height="Auto" Orientation="Vertical">
         <Menu x:Name="menu">
           <!-- MENU ITEMS REMOVED -->
          </Menu>
           <Grid x:Name="DockingRegion" >
        <ad:DockingManager x:Name="DockManager">
            <ad:ResizingPanel>
                <ad:DocumentPane Margin="0,0,0,0">
                    <sc:StartPage Title="Home Page" VerticalContentAlignment="Stretch" 
                        onProjectOpenFail="StartPage_onProjectOpenFail" 
                        onProjectOpenSuccess="StartPage_onProjectOpenSuccess"
                        onProjectCreateSuccess="StartPage_onProjectCreateSuccess"
                        onProjectCreateFail="StartPage_onProjectCreateFail"/>
                </ad:DocumentPane>
                <ad:DockablePane ad:ResizingPanel.ResizeWidth="300" x:Name="ExplorerPane" FontSize="14" FontWeight="Bold">
                    <sc:AboutTab x:Name="about" Title="About" FontSize="14" FontWeight="Bold"/>
                    <sc:ProcessExplorer x:Name="pxProcessExplorer" Title="Process Explorer" FontSize="14"/>
                    <sc:DataExplorer x:Name="adDataExplorer" Title="Data Explorer" FontSize="14"/>
                    <!--<sc:UREPExplorer x:Name="adUREPExplorer" Title="UREP Custom Navigation" FontSize="14" Visibility="Hidden"/>-->
                </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>
    </StackPanel>
</Grid>

如何去除白色 space?我必须用什么东西包围它吗?菜单应该放在不同的容器中吗?

它只是默认菜单样式,其中 Background 定义为

<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
    <LinearGradientBrush.GradientStops>
        <GradientStop Color="#FFF6F6F6" Offset="0.25" />
        <GradientStop Color="#FFEAE8E8" Offset="0.25" />
        <GradientStop Color="#FFDCD9D9" Offset="0.8" />
        <GradientStop Color="#FFFFFFFF" Offset="1" />
    </LinearGradientBrush.GradientStops>
</LinearGradientBrush>

如果您不喜欢 #FFFFFFFF 底线,请定义不同的背景。