title: How to call method of another class from differnet class in Xamarin
body: <p>I am new to xamarin.forms. </p>
  
  <p>On main page I have button "Select Photos". When user click popup open with number of images. When user tap and image popup closes. </p>
  
  <p>I want to do is when popup close; I want to display the selected image on main page so user know what image they selected. </p>
  
  <p>So I have method on the popup page for image click. In the method I save the image name as variable. And I try to call another method which is on main page. The Method on the main page would get the variable and display the Image.</p>
  
  <p>This is code when user tap image</p>
  
  <pre><code>        public void Idpty1(object sender, EventArgs args)
          {
              Signtype = "1";
  
              //save the image name as variable
              SelectedTypeImage = "idpty1.png";
  
              //On the Newphoto page; call close popup function. 
              new NewPhotoPage().ClosePopover();
  }
  </code></pre>
  
  <p>This is function on main page and I am trying to call this function with above function. </p>
  
  <pre><code> public void ClosePopover()
       {
  
         //Close the popover 
         PopupNavigation.Instance.PopAsync();
  
         //Get the variable which was set on the popover page (image name)
         SelectedTypeImage = MyPopupPage.SelectedTypeImage;
  
          // Source the image from variable. 
          SelectedType.Source = SelectedTypeImage ;
  
  
          //DisplayAlert("Alert2", SelectedTypeImage, "ok");
  
           System.Diagnostics.Debug.WriteLine("test");
      }
  </code></pre>
  
  <p>This is image code in the main page</p>
  
  <pre><code>&lt;Image x:Name="SelectedType" Resources=""&gt;&lt;/Image&gt;
  </code></pre>
  
  <p>In the above code; image part does not work, image source does not work also display alert does not work. BUT SYSTEM.DEBUG WORKS. </p>
  
  <p>What I don't understand is function does get call but even display alert does not work. </p>