I want to have an event that takes an enum only as the argument. For example
public enum MyEvents{
Event1
}
// how do I declare this to take enum MyEvent
I might be late in the game, but how about:
public event Action EventTriggered = delegate { };
private void Trigger(MyEvent e)
{
EventTriggered(e);
}
Setting the event to an anonymous delegate avoids for me to check to see if the event isn't null.
I find this comes in handy when using MVVM, like when using ICommand.CanExecute Method.