private void buttonChange_Click(object sender, RoutedEventArgs e) { foreach (RadioButton rb in this.radioButtonPanel.Children) { if (rb.IsChecked.Value) { selectedCase = rb.Tag.ToString(); break; } } ChangeCase?.Invoke(this, e); }