Q:

Xamarin forms: Why Popupimage showing 2 times?

I am using Rg.Plugins.Popup(1.1.4.129-beta) for showing popupimage. I am using the following code for showing popuppage.
await PopupNavigation.Instance.PushAsync(new UploadImagePopupPage(imagepath), true);

My Issue
Sometimes popup showing 2 times.
Issues scenario
First I call the popupimage like below from one contentpage.
//Checking one condition
if (_images.Count != 0)
{
   await PopupNavigation.Instance.PushAsync(new UploadImagePopupPage(picturepath), true);
}

In UploadImagePopupPage added following code for showing the image:
popupimage.Source = picturepath;   

Then from the UploadImagePopupPage I send a message like below when clicking a button. As a result, the next image in the observablecollection will show as the popup.
MessagingCenter.Send<UploadImagePopupPage>(this, "complete");

Then again call the popupimage from the initial page like following:
MessagingCenter.Subscribe<UploadImagePopupPage>(this, "complete", (sender) =>
{
   ShowImagePopUp();
});

public async void ShowImagePopUp()
    {
        try
        {
            //Removing current popup
            await PopupNavigation.Instance.PopAsync();

             //Checking one condition
            if (Utility.picturecount < _images.Count)
            {
               // Following popup code invoking 2 times
                await PopupNavigation.Instance.PushAsync(new UploadImagePopupPage(_images[Utility.picturecount]), true);
            }
            else
            {
                _images.Clear();
                await Navigation.PopModalAsync();
            }
            Utility.loadPhotoAlbum = true;
        }
        catch (Exception e)
        {
            Debug.WriteLine("Exception:>>"+e);
        }
    }

I implemented this to show the observablecollection images one by one as popup. There is a button in the popuppage, and when clicking that button only the next popup will come. Does anyone face this type of issue? 

A:

You need to unsubscribe the event in OnDisappearing
protected override void OnDisappearing() 
{ 
    base.OnDisappearing(); 

    MessagingCenter.Unsubscribe<UploadImagePopupPage>(this, "complete"); 
} 

