Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] RadioButton needs a Value property #11516

@tjdennis

Description

@tjdennis

Summary

A RadioButton needs more than just a Text property. The Text could be in any language if localization is used and would not match a value stored in your database. A Value property provides a consistent value that could be stored and retrieved from the database. Every other UI framework has a Value property available. (HTML, WPF, WinForms, etc).

The Value should be bindable so that you can point all radio buttons in a group to a MVVM property and have the grouping select which one to show as selected.

This is still an experimental control so it should be a safe time to add it.

API Changes

Add a Value property to the RadioButton class.
Grouping should be done on the Value, not the Text.

<RadioButton GroupName="MyGroup" Text="Oui" Value="YES"/>
<RadioButton GroupName="MyGroup" Text="No" Value="NO"/>

See Plugin.InputKit.Shared.Controls.RadioButton in the Xamarin.Forms.InputKit project as an example of one with the Value property.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions