0

我正在关注这里的教程。这是我的 xaml 代码:

<Window x:Class="warm6.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Ribbon x:Name="RibbonWin">
            <!-- help icon on the right side -->
            <Ribbon.HelpPaneContentTemplate>
                <DataTemplate>
                    <RibbonButton SmallImageSource="images\help.png" />
                </DataTemplate>
            </Ribbon.HelpPaneContentTemplate>
            
            <Ribbon.ApplicationMenu>
                <RibbonApplicationMenu SmallImageSource="images\window.png">
                    <RibbonApplicationMenuItem Header="Open" ToolTipTitle="Application Menu"
                                               ImageSource="images\window2.png"/>
                    <RibbonApplicationMenuItem Header="_Save"
                                               ImageSource="images\save.png"/>
                    <RibbonSeparator/>
                    <RibbonApplicationMenuItem Header="_Close" ImageSource="images\close.png"/>
                    <RibbonApplicationMenu.AuxiliaryPaneContent>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <RibbonSeparator Grid.Row="0" Label="Recently Templates" />
                        </Grid>
                    </RibbonApplicationMenu.AuxiliaryPaneContent>
                </RibbonApplicationMenu>
            </Ribbon.ApplicationMenu>

            <RibbonTab>
                
            </RibbonTab>
        </Ribbon>

    </Grid>
</Window>

我发现我的功能区窗口上方有额外的空间,如下所示: 在此处输入图像描述

请帮我改进它!

4

1 回答 1

1

使用RibbonWindow代替Window

<RibbonWindow x:Class="warm6.MainWindow">

    <!-- Window Content -->

</RibbonWindow>
于 2013-08-16T02:52:25.137 回答