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.
ItemsControl
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?
ButtonTool
P.S. Seeing as your forum is completely unsuitable for code snippet display, here is the code: https://gist.github.com/852699
HI,
I am just following up on this forum post.
Please let me know if you need further assistance.
Sincerely, Matt Developer Support Engineer
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.
Hi Gleb,
I am reviewing your issue.
Sincerely, MattDeveloper Support Engineer