ConnectionCost ConnectionCost ConnectionCost ConnectionCost Class

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

Syntax

Declaration

public sealed class ConnectionCostpublic sealed class ConnectionCostPublic NotInheritable Class ConnectionCostpublic sealed class ConnectionCost

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 summary

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

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

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

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

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

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 bool ApproachingDataLimit { get; }public bool ApproachingDataLimit { get; }Public ReadOnly Property ApproachingDataLimit As boolpublic bool ApproachingDataLimit { get; }

    Property Value

    • bool
      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 bool BackgroundDataUsageRestricted { get; }public bool BackgroundDataUsageRestricted { get; }Public ReadOnly Property BackgroundDataUsageRestricted As boolpublic bool BackgroundDataUsageRestricted { get; }

    Property Value

    • bool
      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 NetworkCostTypepublic NetworkCostType NetworkCostType { get; }

    Property Value

  • OverDataLimit
    OverDataLimit
    OverDataLimit
    OverDataLimit

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

    public bool OverDataLimit { get; }public bool OverDataLimit { get; }Public ReadOnly Property OverDataLimit As boolpublic bool OverDataLimit { get; }

    Property Value

    • bool
      bool
      bool
      bool

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

    Remarks

    For Windows Phone Store app, 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 bool Roaming { get; }public bool Roaming { get; }Public ReadOnly Property Roaming As boolpublic bool Roaming { get; }

    Property Value

    • bool
      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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Networking.Connectivity.dll