Wraps a CheckBox in order to display and capture a boolean property of the business object
Inheritance: ControlMapper
 public void TestDisplayingRelatedProperty()
 {
     SetupClassDefs(true);
     _cb = GetControlFactory().CreateCheckBox();
     _mapper = new CheckBoxMapper(_cb, "MyRelationship.MyRelatedTestProp", true, GetControlFactory());
     _mapper.BusinessObject = itsMyBo;
     Assert.IsNotNull(_mapper.BusinessObject);
     Assert.AreEqual(true, _cb.Checked);
 }
        /// <summary>
        /// Adds click event handler
        /// </summary>
        /// <param name="mapper">The checkbox mapper</param>
        public void AddClickEventHandler(CheckBoxMapper mapper)
        {
            var checkBox = mapper.GetControl() as CheckBox;
            if (checkBox == null) return;

            checkBox.CheckedChanged += delegate
            {
                try
                {
                    mapper.ApplyChangesToBusinessObject();
                    mapper.UpdateControlValueFromBusinessObject();
                }
                catch (Exception ex)
                {
                    GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error ");
                }
            };
        }
 public void SetupTest()
 {
     _cb = CreateCheckBox();
     _mapper = new CheckBoxMapper(_cb, "SampleBoolean", false, GetControlFactory());
     _sampleBusinessObject = new Sample();
 }