Implicit Conversion (TimeSpan to Duration)

Duration Implicit Conversion (TimeSpan to Duration)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Implicitly creates a Duration from a given TimeSpan.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public static implicit operator Duration (
	TimeSpan timeSpan
)

Parameters

timeSpan
Type: System.TimeSpan
TimeSpan from which a Duration is implicitly created.

Return Value

Type: System.Windows.Duration
A created Duration.

ExceptionCondition
ArgumentException

timeSpan evaluates as less than TimeSpan.Zero.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft