title: Get the type of calling ContentPage of a PageRenderer within a ExportRenderer
body: <p>I have been following this answer in order to tell if me when my Xamarin Page has loaded. <a href="https://stackoverflow.com/a/63592259/560476">https://stackoverflow.com/a/63592259/560476</a></p>
  <p>The rough idea is that once the <code>PageRenderer</code> has attached to the Window it will fire the <code>PageLoaded</code> message on to the <code>MessagingCenter</code> and my <code>MainPage</code> that is subscribed to that message will then react.</p>
  <p>However the problem with this implementation is that anytime a <code>ContentPage</code> triggers <code>OnAppearing</code> it will trigger <code>PageLoaded</code> to be sent regardless of the <code>ContentPage</code> as it applies to them all.</p>
  <p>I wonder if it is possible to get the type that is calling the <code>ExportRenderer</code> as I could then do something like <code>MessagingCenter.Send(new object(), $&quot;{typeof(MainPage)}Loaded&quot;);</code> and then I would only be subscribing to the <code>ContentPage</code>'s where I want this.</p>
  <pre><code>[assembly: ExportRenderer(typeof(ContentPage), typeof(AdvancedPageRenderer))]
  namespace MyRunCompanion.Droid.Renderer
  {
      public class AdvancedPageRenderer : PageRenderer
      {
          public AdvancedPageRenderer(Context context) : base(context)
          {
              AutoPackage = false;
          }
  
          protected override void OnAttachedToWindow()
          {
              base.OnAttachedToWindow();
  
              MessagingCenter.Send(new object(), &quot;PageLoaded&quot;);
          }
      }
  }
  </code></pre>
  <pre><code>public partial class MainPage : ContentPage
  {
      public MainPage()
      {
          InitializeComponent();
      }
  
      protected override void OnAppearing()
      {
          base.OnAppearing();
  
          MessagingCenter.Subscribe&lt;object&gt;(new object(), &quot;PageLoaded&quot;, (sender) =&gt;
          {
              // Do something whenever the &quot;PageLoaded&quot; message is received
              Console.WriteLine(&quot;Do something whenever the PageLoaded message is received&quot;);
          });
      }
  }
  </code></pre>