Rock Mobile Docs

Check Box

Inherits from Xamarin.Forms.ContentView

The Check Box field allows the user to enter a Yes/No value. It has a number of different display options that will let you control the look and feel of your page.

Properties

PropertyTypeDescription
LabelstringThe label associated with this input field.
IsRequiredboolIf set to true then the user will be required to fill this in. Only applicable with drop down style.
EditStyleCheckBoxStyleThe style to use when displaying the edit control. Defaults to CheckBox.
ColorColorSpecifies the highlight color to be used when displaying as a either a CheckBox or Switch.
IsCheckedbool?Gets or sets the current state of the checkbox. Defaults to false.
YesTextstringThe text to use when displaying the truthy value in the drop down style. Defaults to Yes.
NoTextstringThe text to use when displaying the falsey valye in the drop down style. Defaults to No.
CommandICommandUsed to set the command to be executed when the value changes.
CommandParameterobjectThe parameter to pass to the Command when the value changes.

Check Box Style

ValueDescription
CheckBoxDisplays the control as a simple checkbox that the user can tap on to toggle the state.
SwitchDisplays the control as a toggle switch. When on, it is highlighted with a color.
DropDownDisplays the control as a drop down. When the user taps on the control they are presented with a popup that lets them pick the option they want.

Example

<Rock:FieldContainer>
    <Rock:CheckBox Label="Show All"
                   EditStyle="Switch"
                   Color="#ee7725" />
</Rock:FieldContainer>