Version

Radio Button

The Radio Button tool is useful if you want to present a group of mutually exclusive options to your end user. This type of functionality is synonymous with text alignment in a word-processing application, such as left, center, right, etc. Clicking a button will select the associated option while deselecting the previously selected option. In a word-processing application, you might highlight some text that was left aligned and click the right align button. The right align button would be selected and the previously selected left align button would be deselected. The Radio Button tool derives from Microsoft® Windows® Presentation Foundation’s System.Windows.Controls.RadioButton class; therefore, you get the same functionality as the standard .NET Framework RadioButton control.

The Radio Button tool also implements the IRibbonTool interface, which adds cloning and binding functionality to facilitate advanced xamRibbon™ features. If you aren’t creating your own custom xamRibbon tool, you don’t need to worry about the IRibbonTool interface.

The RadioButtonTool class exposes several extra properties that go a long way towards easily managing a radio button on xamRibbon™. RadioButtonTool exposes several 'Has' and 'Is' properties to help confirm if a property has been set or if the radio button is in a certain state. A few of the standard properties that help set up a RadioButton tool (or any tool) on xamRibbon include:

  • Caption - If a tool’s size is set to where the tool’s caption is visible, you’ll see this text next to the tool.

  • Id - An identification string that xamRibbon uses to associate tools when they’re located in different locations (i.e. a Ribbon Group and the Quick Access Toolbar simultaneously). The Id isn’t required, but it can help you access a tool at run time.

  • KeyTip - Each tool has a Key Tip (similar to main menu mnemonics) associated with it. If you don’t provide one explicitly, xamRibbon will internally choose one for you.

  • LargeImage - Usually a 32 x 32 pixel image. You’ll see this image when a tool’s SizingMode is set to ImageAndTextLarge.

  • SizingMode - This property is read-only and returns how the tool is currently sized on its associated Ribbon group. If you want to set the size of a tool, you can set the RibbonGroup’s MinimumSize and/or MaximumSize attached properties. Also, if you place a tool in a Button Group, the tools will automatically be sized to ImageOnly.

  • SmallImage - Usually a 16 x 16 pixel image. You’ll see this image when a tool’s SizingMode is set to ImageAndTextNormal.

Since xamRibbon tools all derive from and implement the same objects, the functionality for each of them is very similar. The following topics apply to all xamRibbon tools.