I have a checkbox which i need to bind to a bool in the source and also disable or enable a container.
My source is as follows for the binding but it does not work:
private bool isMapEditOn = false;
OnLoadFunction()
{
//Bindings
Binding mapEditBind = new Binding("IsChecked") { Source = isMapEditOn, Mode = BindingMode.TwoWay };
//Bind to check or uncheck the mapEdit Checkbox
ChckEditMap.SetBinding(ToggleButton.IsCheckedProperty, mapEditBind);
//Bind to disable children (point and area buttons).
EditBtnContainer.SetBinding(IsEnabledProperty, mapEditBind);
}
When I test this by checking and unchecking the checkbox, it does not altar isMapEditOn.