开发者

Problem in RibbonControlLibrary

I am facing an issue in Microsoft's RibbonControlLibrary. I have created a simple WPF application and I am using RibbonControlLibrary to create a ribbon bar on top. Problem is shown in image below.

Problem in RibbonControlLibrary

Problem is that Menu under "Something" on only expand as much as there are items in left menu i.e. Item1, Item2... If I increase an item in left menu I get this

Problem in RibbonControlLibrary

but there are sill items missing in menu under Something.

below is XAML I am using

 <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>

code

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

What should I do to expand menu under "Something" as much as there are items in the list?


Try adding the following attribute to your Grid element: ScrollViewer.VerticalScrollBarVisibility="Auto"

                <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> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜