title: Xamarin forms button send alternately boolean true or false on click
body: <p>I am a novice in Xamarin,</p>
  
  <p>I am looking for a way to send a
  alternately  a boolean true/false when I click on a button</p>
  
  <p>here is my button :   </p>
  
  <pre><code> &lt;Button Text="sendTrueorFalse"   
           CommandParameter="{Binding BooleanTrueOrFalse }" 
           Clicked="OnSort" /&gt;
  </code></pre>
  
  <p>Here is my methode:</p>
  
  <pre><code>void OnSort(object sender,EventArgs e) {
  
          var item = (Button)sender;
  
          var myboolean = (Boolean)item.CommandParameter;
  
          if (myboolean) {
             //do true
          }
  
  
          if (!myboolean){
               //do false
          }
  
  }
  </code></pre>