static bool IsNetworkAvaialable(out NetworkReachabilityFlags flags)
{
if (defaultRouteReachability == null)
{
defaultRouteReachability = new NetworkReachability(new IPAddress(0));
defaultRouteReachability.SetCallback(OnChange);
defaultRouteReachability.Schedule(CFRunLoop.Current, CFRunLoop.ModeDefault);
}
if (defaultRouteReachability.TryGetFlags(out flags))
{
return false;
}
return IsReachableWithoutRequiringConnection(flags);
}