Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

how to invoke a button click on another buttons' click?

$
0
0

Hi,

I am writing a custom renderer for a button (button1) that should invoke the click of another button (button2). When the renderer's button (button1) is clicked, I want it to either just invoke the other button's (button2's) "Clicked" event, or I want some way to just set that other button to be disabled, and then enabled after some operation is finished. The only problem with the second option is that when I set the button to be disabled, it waits until finishing the operation before showing the update on the screen, thus the user is still able to click the button while the method is running (which can take up to a few seconds).

private void Button1ClickHandler(object sender, EventArgs e){
button2.IsEnabled = false;
Button1ClickHandler(sender, e); //takes time
button2.IsEnabled = true;
}


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>