Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Created January 13, 2016 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevingosse/3933dd3f2197ad7be350 to your computer and use it in GitHub Desktop.
Save kevingosse/3933dd3f2197ad7be350 to your computer and use it in GitHub Desktop.
private static bool ShouldLoadHiResolutionPicture()
{
var connectionCost = NetworkInformation.GetInternetConnectionProfile()?.GetConnectionCost();
if (connectionCost == null)
{
return false;
}
switch (connectionCost.NetworkCostType)
{
case NetworkCostType.Unrestricted:
return true;
case NetworkCostType.Fixed:
case NetworkCostType.Variable:
return !connectionCost.ApproachingDataLimit && !connectionCost.OverDataLimit && !connectionCost.Roaming;
default:
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment