I am working in Prism where CallerMember
attribute is not working well with my code. I have a Close
method and want to know from where the Close
method get calls. Normally the memberName parameter marked using CallerMember
attribute should receive calling method name. But the Subscribing and unsubscribing code shows, this eventAggregator has some invalid arguments. Any help would greatly appreciated.
private void Close(bool isOKCommand,[CallerMemberName] string memberName = "")
{
this.eventAggregator.GetEvent<ShowWarningMessageEvent>().Unsubscribe(this.Close);
if (isOKCommand)
{
//Doing some operations;
}
}
There could be an issue in the way you have called and used
Unsubscribe
method ofEventAggregator
which is the reason you are gettingInvalid Arguments
exception.