Display Alert not showing on UI in Xamarin Forms Application
Matt Alanskas
1
Reputation point
I have a Xamarin Forms application issue going on. I use display alert throughout the application in the same way, and it works every time. When I call this specific function, the display alert gets hit as a breakpoint when I debug, but the actual alert never displays on my application. I have attached the code that is causing me problems. The Display Alert is being hit, so I am at a lost why its not showing on the UI. Thanks! This is a ContentPage in a View
public async void dfuState(string dfuState)
{
bool answer = false;
if (dfuState == "Completed")
{
MainThread.BeginInvokeOnMainThread(async () =>
{
await DisplayAlert("Alert", "No internet connection", "Ok");
// Code to run on the main thread
});
if (answer)
{
await Task.Delay(1000);
SelectADevicePageViewModel._instance.SelectedDevice = null;
DfuInstallationConfigurationPageViewModel._instance = new DfuInstallationConfigurationPageViewModel();
await Application.Current.MainPage.Navigation.PopAsync();
}
}
}
Developer technologies .NET Xamarin
5,380 questions
Sign in to answer