Hi.
I'm using the ButtonTool in XamRibbon. I'd like to have some button with larger appearance than others. For this I've tried to increase the buttons height but found out the buttons image and content do not increase respectively. Is there a way in which I'd be able to increase my icons?
Thanks,
Izhar Lotem
Just as with Office, the images of the tools are either small (16x16 in our default templates) or large (32x32) in our default templates. A ButtonTool on a RibbonGroup will use the small image whenever its SizingMode is ImageOnly or ImageAndTextNormal and will use the large image size when its SizingMode is ImageAndTextLarge. By default the attached property RibbonGroup.MaximumSize is ImageAndTextNormal for a ButtonTool. If you want it to be large you can set this property to ImageAndTextLarge. If you don't want the resizing logic to reduce the size of the tool when there isn't enough room you would set the RibbonGroup.MinimumSize attached property to ImageAndTextLarge. If you want to use sizes other than our defaults then you would need to retemplate the elements. You can use the default styles we ship with the product (located in the DefaultStyles directory) as the starting point for your custom templates.
Hi, I am creating ButtonTool dynamically and I've set RibbonToolSizingMode to ImageAndTextLarg, but still is the image inside Button small. Pl, need solution. thanx
RibbonTabItem rti = new RibbonTabItem(); rti.Name = bri.ribTab; rti.Header = bri.ribTabName; rti.Height = 20; rti.FontSize = 10; rti.RibbonGroups.Clear(); RibbonGroup = new RibbonGroup(); rg.Id = bri.ribSection; rg.Caption = bri.ribSectionName; RibbonGroup.SetMaximumSize(rg, RibbonToolSizingMode.ImageAndTextLarge); ToolHorizontalWrapPanel thwp = new ToolHorizontalWrapPanel(); thwp.MinRows = 3; rg.Items.Add(thwp); ButtonTool btn; foreach (BasicRibbonItem bi in polozky) { btn = new ButtonTool(); btn.Name = "btn" + bi.Name; btn.LargeImage = new BitmapImage(new Uri(bi.Image, UriKind.Relative)); btn.Caption = "Example"; thwp.Children.Add(btn); } rti.RibbonGroups.Add(rg); ribbon.Tabs.Add(rti);
You're setting the MaximumSize of the RibbonGroup - you need to set it on the ButtonTool instances.
It worked, thak you. If I understand You well, when I want these images even bigger than 32X32, i need to retemplate the element. Do you have some sample souce code, how to do that?
You would need to copy the default styles that ship with the product (e.g. in the DefaultStyles directory) and modify them to suit your needs.
Im new use infragistics. I have a problem when design ribbon:
-I display some ButtonTool in a line with the text in the right of image so image is 16*16.
I want all Image display 32*32. Please help me . Thanks
The licensing and Microsoft UI Guidelines for the Ribbon is rather specific about what is and isn't allowed in the ribbon ui so you may want to refer to that to know what you are allowed to do. That states that with regards to large images/controls the text must be centered below the image. In the xamRibbon if you want a ButtonTool to display a large image you would set the attached RibbonGroup.MinimumSize property to ImageAndTextLarge. Note this will only work when the tool is within a ToolHorizontalWrapPanel or a ToolVerticalWrapPanel (or directly within the ribbon group as its default panel is a ToolVerticalWrapPanel).
You could retemplate the elements to handle that but as I indicated that would be a violation of your license agreement with Microsoft to utilize the Office Ribbon UI.
Thanks for the reply. if I attached igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge" then Image set small. Wen I attached igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge" then lo
Image set large but my text in centered below the image. If I want to set large image in left of text , can I
use template.
thanks