I'm working on Xamarin Forms project in Visual Studio 2017 . I need to implement async method inside thread .
Event which starting the thread
public void btnAction_Click(object sender, System.EventArgs e)
{
var load = new System.Threading.Thread((t) =>
{
ShowWarning();
});
load.Start(btnText);
}
async method should implement inside the thread
private async void ShowWarning()
{
bool response = await DisplayAlert("Warning", "Please Enter
The Key","Yes","No");
}
async voidis only meant for event handlers. Why use a thread at all? - Panagiotis Kanavos