Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Should we unsubscribe all events for memory management?

$
0
0

I think that we dont need to unsubscribe an event if defined in xaml. if we subscribe named event like that in OnAppearing method of the page
_listView.SelectionChanged += listviewchangedevent;

we need to unsubscribe on OnDissapearing method

_listView.SelectionChanged -= listviewchangedevent;

But what about below usage?
_listView.SelectionChanged += (sender, args) =>
{
// Do something
};

Can this cause a memory cycle?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>