private void loadGenders() { genders = new Dictionary <string, bool>(); buttonGroup = new List <GenderCheck>(); if (genderMode == 0) { genders = Conexion.loadAllGenders(false); } else if (genderMode == 1) { genders = Conexion.loadGenders(false, rutaFolder); } else if (genderMode == 2) { genders = Conexion.loadAllGenders(false); //getSelectedGenders } if (genders != null && genders.Count > 0) { foreach (KeyValuePair <string, bool> gender in genders) { GenderCheck gb = new GenderCheck(gender.Key, gender.Value); gb.Margin = new Thickness(5); buttonGroup.Add(gb); } reloadButtons(buttonGroup); } }
private void changeSelection(object sender, EventArgs e) { Button button = (Button)sender; GenderCheck gb = getButtonByTag(button.Tag.ToString()); if (gb != null) { if (gb.isSelected() == true) { gb.changeSelection(false); } else if (gb.isSelected() == false) { gb.changeSelection(true); } } }