I have a msgClass looking like this for all my appMessages ( using mvvm light messenger )
public static class AppMessages
{
enum MessageTypes
{
changeStateMsg,
inputMsg
}
public class MsgBase
{
public static void unRegister(object recipient)
{
Messenger.Default.Unregister<bool>(recipient);
}
}
public static class changeState : MsgBase
{
public static void Send(bool stateChange)
{
Messenger.Default.Send<bool>(stateChange, MessageTypes.changeStateMsg);
}
public static void Register(object recipient, Action<bool> action)
{
Messenger.Default.Register<bool>(recipient, MessageTypes.changeStateMsg, action);
}
}
public static class inputMsg : MsgBase
{
public static void Send(string key)
{
Messenger.Default.Send<string>(key, MessageTypes.inputMsg);
}
public static void Register(object recipient, Action<string> action)
{
Messenger.Default.Register<string>(recipient, MessageTypes.inputMsg, action);
}
}
}
Just wandered if is possible to make it more VS tab friendly I´am registrating it like this :
AppMessages.changeState.Register(this, onStateChange );
My question is how can I make it auto-generate the onStateChange method ( rightClicking only makes me able to make a property/field )
So its a “being lazy question” I know I should only write this :
public void onStateChange(bool b)
{
}
But if any of you know how to autogenerate it ?? I whould be happy 🙂
/cheers
I think this is a limitation of VS. Resharper on the other hand is able to do this.