Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
Unable to get large ribbon buttons
posted

I have the following XAML structure:

<igRibbon:RibbonTabItem x:Name="ModuleLauncherTab"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igRibbon="clr-namespace:Infragistics.Windows.Ribbon;assembly=InfragisticsWPF3.Ribbon.v10.3"

Header="Launcher">
<ItemsControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igRibbon="clr-namespace:Infragistics.Windows.Ribbon;assembly=InfragisticsWPF3.Ribbon.v10.3">
<ItemsControl.ItemsPanel>

<ItemsPanelTemplate>
<igRibbon:ToolHorizontalWrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>

<igRibbon:ButtonTool Caption="{Binding Name}"
Command="{Binding Launch}"
ToolTip="{Binding Description}"
LargeImage="{Binding Image}"
igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge"

igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</igRibbon:RibbonTabItem>

At run time button tools are added to the ItemsControl depending on the bound collection.

No matter what I try, the added buttons use small images (autoresized from 32x32) and caption on the right. How can I force the dynamically added ButtonTool instances to display large images and caption underneath instead?

P.S. Seeing as your forum is completely unsuitable for code snippet display, here is the code: https://gist.github.com/852699

Parents
No Data
Reply
  • 54937
    Suggested Answer
    Offline posted

    The layout of the elements within the tools is based upon the SizingMode which by default is ImageAndTextNormal. The SizingMode is only initialized by the RibbonGroupPanel for tools within the various tool panels (i.e. ToolVerticalWrapPanel, ToolHorizontalWrapPanel, ButtonGroup) that are within a RibbonGroup. Since you are not using a RibbonGroup the tools are not going to have their SizingMode initialized and so they remain at the default value. Instead of using an ItemsControl you should use a RibbonGroup.

Children