private static string GetSelectedValue(ComboBox comboBox) { return comboBox.SelectedItem != null ? ((KeyValuePair<string, string>)comboBox.SelectedItem).Value.ToRStringLiteral() : null; }