我在 Microsoft 的RibbonControlLibrary
. 我创建了一个简单的 WPF 应用程序,我正在使用RibbonControlLibrary
它在顶部创建一个功能区栏。问题如下图所示。
问题是“某事”下的菜单仅扩展与左侧菜单中的项目一样多,即项目1,项目2 ...如果我在左侧菜单中增加一个项目,我会得到这个
但是Something下的菜单中缺少一些窗台项目。
下面是我正在使用的 XAML
<Ribbon:Ribbon ItemsSource="{Binding Path=CSIMRibbonTabs}">
<Ribbon:Ribbon.ApplicationMenu>
<Ribbon:RibbonApplicationMenu CanUserResizeVertically="True" ItemsSource="{Binding Path=MainItem}">
<Ribbon:RibbonApplicationMenu.AuxiliaryPaneContent>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border >
<StackPanel Orientation="Vertical">
<Label Content="Something" />
</StackPanel>
</Border>
<ItemsControl Grid.Row="1" ItemsSource="{Binding Path=OtherItems}"/>
</Grid>
</Ribbon:RibbonApplicationMenu.AuxiliaryPaneContent>
</Ribbon:RibbonApplicationMenu>
</Ribbon:Ribbon.ApplicationMenu>
</Ribbon:Ribbon>
代码
public List<string> MainItem
{
get
{
return new List<string>() { "Item1", "Item2", "Item3"};
}
}
public List<string> OtherItems
{
get
{
return new List<string>() { "val1", "val2", "val3", "val4", "val5", "val6", "val7", "val8" };
}
}
我应该怎么做才能在列表中有项目的情况下扩展“某事”下的菜单?