I tried this code for some reason upon clicking the checkbox it doesnt change the value of the behind.
I found this post but didnt fully understand how it works.
Xaml
<CheckBox Color="#9E9D9B"
x:Name="red"
IsChecked="{Binding RedBool}"/>
Code Behind
public static readonly BindableProperty RedBox = BindableProperty.Create(
propertyName: nameof(RedBool),
returnType: typeof(bool),
declaringType: typeof(NewCraft),
defaultValue: false,
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: changedProperty);
private static void changedProperty(BindableObject bindable, object oldValue, object newValue)
{
var redBind = (NewCraft)bindable;
redBind.RedBool = (bool)newValue;
}
public bool RedBool
{
get => (bool)GetValue(RedBox);
set => SetValue(RedBox, value);
}