Export (0) Print
Expand All

Duration.op_Subtraction Method

Subtracts the value of one instance of Duration from another.

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

public static Duration operator - (
	Duration t1,
	Duration t2
)
You cannot use methods in XAML.

Parameters

t1

The first instance of Duration.

t2

The instance of Duration to subtract.

Return Value

If both instances of Duration have values, an instance of Duration that represents the value of t1 minus t2. If t1 has a value of Forever and t2 has a value of TimeSpan, this method returns Forever. Otherwise this method returns a null reference (Nothing in Visual Basic).

The following calculations all return a value of Automatic.

  • Forever minus Forever.

  • TimeSpan minus Forever.

  • TimeSpan minus Automatic.

  • Forever minus Automatic.

  • Automatic minus Automatic.

  • Automatic minus Forever.

  • Automatic minus TimeSpan.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft