ConnectionCost ConnectionCost ConnectionCost ConnectionCost Class

Definition

Provides access to property values that indicate the current cost of a network connection.

public : sealed class ConnectionCost : IConnectionCost, IConnectionCost2
public sealed class ConnectionCost : IConnectionCost, IConnectionCost2
Public NotInheritable Class ConnectionCost Implements IConnectionCost, IConnectionCost2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

For more information on using cost data to manage connectivity, see Quickstart: Managing metered network cost constraints.

On Windows Phone 8.1 the Roaming property indicates roaming for international roaming only.

Properties

ApproachingDataLimit ApproachingDataLimit ApproachingDataLimit ApproachingDataLimit

Gets a value that indicates if a connection is approaching the data usage allowance specified by the data plan.

public : Platform::Boolean ApproachingDataLimit { get; }
public bool ApproachingDataLimit { get; }
Public ReadOnly Property ApproachingDataLimit As bool
var bool = connectionCost.approachingDataLimit;
Value
Platform::Boolean bool bool bool

TRUE if the connection profile is close to the data limit threshold; otherwise, FALSE.

BackgroundDataUsageRestricted BackgroundDataUsageRestricted BackgroundDataUsageRestricted BackgroundDataUsageRestricted

Gets a value that indicates whether background data usage has been restricted.

public : Platform::Boolean BackgroundDataUsageRestricted { get; }
public bool BackgroundDataUsageRestricted { get; }
Public ReadOnly Property BackgroundDataUsageRestricted As bool
var bool = connectionCost.backgroundDataUsageRestricted;
Value
Platform::Boolean bool bool bool

True if background data usage is restricted.

NetworkCostType NetworkCostType NetworkCostType NetworkCostType

Gets a value that indicates the current network cost for a connection.

public : NetworkCostType NetworkCostType { get; }
public NetworkCostType NetworkCostType { get; }
Public ReadOnly Property NetworkCostType As NetworkCostType
var networkCostType = connectionCost.networkCostType;
Value
NetworkCostType NetworkCostType NetworkCostType NetworkCostType

The network cost of the connection.

See Also

OverDataLimit OverDataLimit OverDataLimit OverDataLimit

Gets a value that indicates if the connection has exceeded the data usage allowance specified by the data plan.

public : Platform::Boolean OverDataLimit { get; }
public bool OverDataLimit { get; }
Public ReadOnly Property OverDataLimit As bool
var bool = connectionCost.overDataLimit;
Value
Platform::Boolean bool bool bool

TRUE if the current total data usage is over the specified data limit; otherwise, FALSE.

Remarks

For Windows Phone 8.x apps, when the device is in the OverDataLimit state, network connectivity is disabled for background tasks.

Roaming Roaming Roaming Roaming

Gets a value that indicates whether the connection is connected to a network outside of the home provider.

public : Platform::Boolean Roaming { get; }
public bool Roaming { get; }
Public ReadOnly Property Roaming As bool
var bool = connectionCost.roaming;
Value
Platform::Boolean bool bool bool

TRUE if the connection on a roaming network; otherwise, FALSE.

Remarks

On Windows Phone 8.1, the Roaming property indicates roaming for international roaming only.

See Also