I would like to ask that how can I do a continuously internet connection checking in my UWP apps and shows warning dialog which allow the apps to be idle when the apps is disconnect? This is because when internet is disconnected, as there are many function require internet connection, so the apps just quit by itself without any notification. So far I know how to check the connection but not continuously.
private void CheckInternetAndShowDialog()
{
bool isConnected = NetworkInterface.GetIsNetworkAvailable();
if (isConnected)
{
textBlock1.Text = "Is Connected";
}
else
{
textBlock1.Text = "Disconnected";
}
}