private void DoSelection() { if (toselect == null) { return; } var q = (from i in Content.FindChildren <RadioButton>() where i.Content.ToString() == toselect select i).FirstOrDefault(); if (q == null) { return; } else { q.IsChecked = true; toselect = null; } }