public void CheckTopics(List <string> labels) { //use it to read from DDI(process to put a check in the checkbox) List <string> otherLabels = new List <string>(); foreach (string label in labels) { CheckOption option = CheckOption.FindByLabel <CheckOption>(Topics, label); if (option != null) { option.IsChecked = true; } else { otherLabels.Add(label); } } if (otherLabels.Count > 0) { //If labels that do not match exists, take only the first one CheckOption option = CheckOption.FindMemoOption(Topics); option.IsChecked = true; option.Memo = otherLabels.First(); } }
public void CheckAreas(List <string> labels) { foreach (string label in labels) { CheckOption option = CheckOption.FindByLabel <CheckOption>(Areas, label); if (option != null) { option.IsChecked = true; } } }