1
我正在为我的应用程序创建功能区控件,并且我已经编写了大部分代码。我面临的唯一问题是我添加到选项卡的功能区按钮未在Tab中正确对齐。正如您在屏幕截图中看到的那样,该按钮对齐到Tab的底部。如何将这些按钮置于顶部以便它们可见。RibbonButton未正确对齐WPF中的功能区控件
这是我的应用程序看起来像
的XAML代码如下
<UserControl x:Class="SongPurifier.UserControls.RibbonControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ribbon="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
>
<Grid>
<ribbon:Ribbon x:Name="ribbon" VerticalAlignment="Top">
<ribbon:RibbonTab Header="Home">
<ribbon:RibbonSplitButton
Label="Open"
LargeImageSource="/Images/Folder Open.png"
Command="{Binding OpenFolderCommand}">
</ribbon:RibbonSplitButton>
</ribbon:RibbonTab>
<ribbon:RibbonTab Header="Edit" >
<ribbon:RibbonButton Label="Replace String"
LargeImageSource="/Images/Find Replace.png"
Command="{Binding EditSongInfoCommand}"
>
</ribbon:RibbonButton >
<ribbon:RibbonButton Label="Update Song Info"
LargeImageSource="/Images/Update.png"
Command="{Binding UpdateSongInfoCommand}"
>
</ribbon:RibbonButton>
</ribbon:RibbonTab>
<ribbon:RibbonTab Header="Update" >
<ribbon:RibbonButton
Label="Check for Update" >
</ribbon:RibbonButton>
</ribbon:RibbonTab>
</ribbon:Ribbon>
</Grid>
是的工作!根据我的要求,我不认为我需要在RibbonGroup中添加按钮,但是现在在这个ans之后,并且看看MSFT给出的示例示例示例,我认为您必须这样做。 – 2012-01-03 23:57:39