I just created yet another handler for an event, and thought.. perhaps I'm just being supersticious here. I've looked at memory guidelines; but didn't see any clear cut answers.
What's the score with code like this:
_player.Completion += _player_Completion;
void _player_Completion (object sender, EventArgs e)
{
if (Element != null) {
Element.HandlePlaybackFinished ();
}
}
is it safe to write it as ? or will that leak?
_player.Completion += (object sender, EventArgs e)=>Element.HandlePlaybackFinished ();
Has anyone got a good blog article they can point to on the subject. I didn't find the Xamarin official documents particularly helpful.