title: RestSharp on Response dont know how to call callback
body: <p>I´m using restsharp for getting data from a API that I´m doing, I would like to make a class called "ApiInterface" that will be used in Xamarin (Android, iOS, Windows...) to call to the API.</p>
  
  <p>This class has its RestClient and funcions that will be called from any part of the code as it´s a singleton. </p>
  
  <p>So for example I will have a MainActivity.cs something like this. (Calling to my getData function and doing stuff with the data that I received).</p>
  
  <pre><code>Button buttonListaIntereses = FindViewById&lt;Button&gt; (Resource.Id.myButton);
  
  buttonListaIntereses.Click += delegate {
      ApiInterface.Instance.getData(response2=&gt;
      {
          Intent displayMessage = new Intent(this, typeof(DisplayMessage));
          //Put info in Extra for the new screen.
          displayMessage.PutExtra("content", response2.Content);
          StartActivity(displayMessage);
      });
  };
  </code></pre>
  
  <p>But in the APIInterface I would like to get common data like cookies. </p>
  
  <pre><code>public async void getData(Action &lt;IRestResponse&gt; onDone)
  {           
      RestRequest request = new RestRequest("getData", Method.GET);
  
     //Execute ASYNC the rest request
      m_Client.ExecuteAsync (request, response =&gt;
      {
          //Do my stuff with headers.
          string lCookie = response.Headers.ToList().Find(x =&gt; x.Name == "Cookie").Value.ToString();
         //Execute the OnDone
         onDone();
      });
  }
  </code></pre>
  
  <p>My problem is that I´m not sure how to execute my OnDone in the getData and/or how to call the getData function.</p>
  
  <p>Thanks!</p>