In This Article

RadioButton Class

Represents a radio button ribbon control.

public class RadioButton : ButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
Inheritance:
object Visual UIElement FrameworkElement Control ControlBase ButtonBase object
Implements:
IKeyTipTarget ILogicalParent IVariantControl

Remarks

For detailed documentation on this control's features and how to use them, please see the RadioButton documentation topic.

Constructors

RadioButton()

Initializes an instance of the RadioButton class.

public RadioButton()

RadioButton(ICommand)

Initializes an instance of the RadioButton class.

public RadioButton(ICommand command)
Parameter Type Description
command ICommand

The ICommand to assign to the button.

Properties

IsThreeState

Gets or sets whether the control supports two or three states.

public bool IsThreeState { get; set; }

Property Value

bool:

true if the control supports three states; otherwise, false. The default value is false.

Methods

CoerceCommandParameter(DependencyObject, object)

Coerces a new CommandParameterProperty value.

protected override object CoerceCommandParameter(DependencyObject obj, object value)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject whose property is changed.

value object

The new value being set.

Returns

object:

The coerced value to set.

OnClick(ExecuteRoutedEventArgs)

Called when the control is clicked and a Click event is raised

protected override void OnClick(ExecuteRoutedEventArgs e)
Parameter Type Description
e ExecuteRoutedEventArgs

An ExecuteRoutedEventArgs that contains the event data.

OnContextChanged(ControlContext, ControlContext)

Occurs when the Context property is changed.

protected override void OnContextChanged(ControlContext oldContext, ControlContext newContext)
Parameter Type Description
oldContext ControlContext

The old ControlContext value.

newContext ControlContext

The new ControlContext value.

OnKeyTipAccessed(string)

Called when key tip access text for the control is typed by the end user.

protected override bool OnKeyTipAccessed(string keyTipAccessText)
Parameter Type Description
keyTipAccessText string

The key tip access text that was typed.

Returns

bool:

true if an action was executed that should stop key tip mode; otherwise, false.

Remarks

Implementations of this method should either execute the action associated with the control or move focus to the control so that the end user can take further action such as in a menu.

OnToggle()

Occurs when the checked state of the control is to be toggled.

protected virtual void OnToggle()

OnVariantSizeChanged(VariantSize, VariantSize)

Occurs when the VariantSize property is changed.

protected override void OnVariantSizeChanged(VariantSize oldVariantSize, VariantSize newVariantSize)
Parameter Type Description
oldVariantSize VariantSize

The old VariantSize value.

newVariantSize VariantSize

The new VariantSize value.

Fields

IsThreeStateProperty

Identifies the IsThreeState dependency property. This field is read-only.

public static readonly DependencyProperty IsThreeStateProperty

Inherited Members