Ah yes sorry, that would help, it is on Android. Just looking back the snipped did not post correctly, maybe because there were < and > in it? - it should read:
private Dictionary<int, MenuSelectAction> _menuSelectActions = new Dictionary <int, MenuSelectAction>();
I tried to compile the code here with 2 ways. First way is using Dictionary from java.utils namespace and it gave me an error that Dictionary is an abstract class and cannot be instantiated. The second is using Dictionary from sugar.collections namespace, and in that way code compiles absolutely fine (no errors).
That’s my code:
public interface ICoreOptionsMenu
{
}
public delegate void MenuSelectAction(ICoreOptionsMenu optionsMenu, MenuItem menuItem);
public class MyClass
{
private Dictionary<int, MenuSelectAction> _menuSelectActions = new Dictionary<int, MenuSelectAction>();
}
What am I missing here? Could you please provide us with a project that shows your error?
Sorry I should have also specified that yes am using sugar.collections. Your example is spot on just minus the generic parameters on the dictionary. I’ll post a new example when I get home next week.