Duration Implicit Conversion (TimeSpan to Duration)

 
equivalentCodeEntityM:System.Windows.Duration.#ctor(System.TimeSpan)

Implicitly creates a Duration from a given TimeSpan.

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

public:
static operator Duration (
	TimeSpan timeSpan
)

Parameters

timeSpan
Type: System::TimeSpan

TimeSpan from which an instance of Duration is implicitly created.

Return Value

Type: System.Windows::Duration

A new instance of Duration.

Exception Condition
ArgumentException

Occurs when TimeSpan is negative.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: