title: How to handle button click from iOS and Android par separately from Xamarin iOS and Xamarin Android app using Xamarin Forms using PCL
body: <p>I am new in C# and Xamarin I am creating a Xamarin Forms App and want o create an button that can handle different task from different platform (i.e. iOS &amp; Android).
  Suppose I want to use a binding binding library (android binding Library and other is iOS Binding library). On a button click in Xamarin Forms App I want to execute platform specific library method for example suppose in Android Binding library there is a method <code>void ShowAndroidContent();</code> and on the other iOS Binding library there is a method <code>-(void)ShowiOSContent;</code> so On the button click if device is Android <code>ShowAndroidContent();</code> should be execute and if iOS then <code>ShowiOSContent();</code> should be execute.
  My Solution Name is <strong>XamarinFormsAppDemo</strong></p>
  
  <hr>
  
  <p><strong>TestXamarinFormAppPage.xaml Code is:-</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:TestXamarinFormApp" x:Class="TestXamarinFormApp.TestXamarinFormAppPage"&gt;
  &lt;AbsoluteLayout&gt;
    &lt;StackLayout AbsoluteLayout.LayoutBounds="0,1,1,0.1"
                 AbsoluteLayout.LayoutFlags="All"
                 BackgroundColor="Transparent"&gt;
              &lt;Button Text="Click Me !" Clicked="OnButtonClicked"&gt;&lt;/Button&gt;
      &lt;/StackLayout&gt;
  &lt;/AbsoluteLayout&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <h2><strong>TestXamarinFormAppPage.xaml.cs Code is:-</strong></h2>
  
  <pre><code>using System;
  using Xamarin.Forms;
  using System.Runtime.CompilerServices;
  using System.ServiceModel.Channels;
  
  namespace TestXamarinFormApp
  {
      public partial class TestXamarinFormAppPage : ContentPage
      {
          public TestXamarinFormAppPage ()
          {
              InitializeComponent ();
          }
          int count = 0;
          public void OnButtonClicked (object sender, EventArgs args)
          {
  
  
  
  
  // here if device is Android the button click should be handle from MainActivity.cs in TestXamarinFormApp.Droid part and
  
  
  // if device is an iOS then this button click should be handle from Main.cs in  TestXamarinFormApp.iOS
  
  
  
  
          }
      }
  }
  </code></pre>
  
  <p>I'am using Xamarin Studio for it.
  Can anybody help me to do this. Please help me. Thank you.</p>