Duration.Subtraction(Duration, Duration) 运算符

定义

从另一个值中减去 Duration 的值。Subtracts the value of one Duration from another.

public:
 static Windows::UI::Xaml::Duration operator -(Windows::UI::Xaml::Duration t1, Windows::UI::Xaml::Duration t2);
public static Windows.UI.Xaml.Duration operator - (Windows.UI.Xaml.Duration t1, Windows.UI.Xaml.Duration t2);
static member ( - ) : Windows.UI.Xaml.Duration * Windows.UI.Xaml.Duration -> Windows.UI.Xaml.Duration
Public Shared Operator - (t1 As Duration, t2 As Duration) As Duration

参数

t1
Duration

第一个 DurationThe first Duration.

t2
Duration

要减去的 DurationThe Duration to subtract.

返回

Duration

如果每个 Duration 都具有值,则 Duration 表示 t1t2 的值。If each Duration has values, a Duration that represents the value of t1 minus t2. 如果 t1 的值为 Forever,并且 t2 的值为 TimeSpan,则此方法返回 ForeverIf t1 has a value of Forever and t2 has a value of TimeSpan, this method returns Forever. 否则,此方法返回 nullOtherwise this method returns null.

注解

此结构表示 Windows 运行时 (WinRT) 结构的 .NET 投影 DurationThis struct represents the .NET projection of the Windows Runtime (WinRT) Duration struct. 有关详细信息,请参阅 UWP API 参考中的 持续时间For more information, see Duration in the UWP API reference.

适用于