I'm programming in WPF(C#). I populate a ComboBox
with this function:
public static void PopulateComboBox(ComboBox cmb, Type type)
{
foreach (string name in Enum.GetNames(type))
{
cmb.Items.Add(name);
}
}
Now I need a method like this (as illustrated below) to get any enum
as output:
public static enum PopulateComboBox(ComboBox cmb, string nameOfEnum, Type type)
{
}
How can I write such function?