2011-05-16 21 views
0

我在Microsoft的RibbonControlLibrary中遇到了一個問題。我創建了一個簡單的WPF應用程序,我使用RibbonControlLibrary在頂部創建一個功能區欄。問題如下圖所示。RibbonControlLibrary中的問題

enter image description here

問題是即項目1,項目2 ......如果我增加左側菜單中的項目,我得到的是在「東西」菜單上不僅擴大不亞於有在左邊的菜單項這個enter image description here

但在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" }; 
      } 
     } 

我應該怎麼做,以擴大在「東西」菜單不亞於有列表中的項目?

回答

0

嘗試添加下列屬性的Grid元素: ScrollViewer.VerticalScrollBarVisibility = 「自動」

   <Ribbon:RibbonApplicationMenu.AuxiliaryPaneContent> 
        <Grid ScrollViewer.VerticalScrollBarVisibility="Auto"> 
         <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>