private void AddBool(ObsProperty property, ObsData setting, List<Control> controls) { string name = property.Name; CheckBox checkbox = new CheckBox { Width = 300, Height = 18, Checked = setting.GetBool(name), Text = property.Description, TextAlign = ContentAlignment.MiddleLeft }; checkbox.CheckedChanged += (sender, args) => { setting.SetBool(name, checkbox.Checked); view.PropertyChanged(property); }; controls.Add(checkbox); }