Skip to content

Instantly share code, notes, and snippets.


kevingosse/AdaptiveImage.cs Secret

Created Jan 13, 2016
What would you like to do?
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;
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.