RadioButtons
struct · ferroui-controls · v0.5.0
struct RadioButtons
A group of radio buttons with one selection (WinUI's RadioButtons).
The items are shown as RadioButtons: an item that is a radio button is its own container,
and another item is the content of a radio button. The selection is the selection of the items
control (SelectedIndex, SelectedItem, SelectionChanged), kept with the checked state of
the containers. The arrow keys move the focus and the selection within the group without
wrapping, Tab enters the group at the selected button, and Ctrl with an arrow key moves the
focus only.
The template is the control theme of the WinUI theme (Controls/RadioButtons.xaml, from
WinUI's RadioButtons.xaml), with the parts PART_HeaderPresenter and PART_ItemsPresenter
(WinUI's HeaderContentPresenter and the ItemsRepeater InnerRepeater); the theme sets the
items panel, a RadioButtonsPanel with the spacing of
the resources RadioButtonsColumnSpacing and RadioButtonsRowSpacing. The Fluent and Simple
themes have no template for it (docs/porting/winui-controls.md, section 5.1).
The exclusive check is the radio button group manager's: the containers are the logical
children of the group and have no group name, so checking one unchecks the others. The group
itself only checks the container of a new selection, and unchecks the container of the old one
when no container is checked instead (a cleared selection, or one whose container is not
realized), which the group manager never does (WinUI's Select writes both containers).
Missing (docs/porting/winui-controls.md, Input): WinUI's element factories and
DataTemplateSelector as ItemTemplate.
Members
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<RadioButtons>
Returns a strong reference to this object.
max_columns_property
fn max_columns_property() -> &'static StyledProperty<i32>
Defines the MaxColumns property: the largest number of columns. 1 by default; a value
less than 1 is 1 (WinUI rejects it with an exception).
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
max_columns
fn max_columns(self: &Self) -> i32
Gets the largest number of columns.
set_max_columns
fn set_max_columns(self: &Self, value: i32)
Sets the largest number of columns.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtHeaderedSelectingItemsControlImplExtSelectingItemsControlImplExtControlImplExtItemsControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<RadioButtons>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplTemplatedControlImplSelectingItemsControlImplHeaderedSelectingItemsControlImplFerroObjectImplControlImplInputElementImplItemsControlImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.