Edit

Share via


WriteableBitmap.TryLock(Duration) Method

Definition

Attempts to lock the bitmap, waiting for no longer than the specified length of time.

public:
 bool TryLock(System::Windows::Duration timeout);
[System.Security.SecurityCritical]
public bool TryLock (System.Windows.Duration timeout);
public bool TryLock (System.Windows.Duration timeout);
[<System.Security.SecurityCritical>]
member this.TryLock : System.Windows.Duration -> bool
member this.TryLock : System.Windows.Duration -> bool
Public Function TryLock (timeout As Duration) As Boolean

Parameters

timeout
Duration

A Duration that represents the length of time to wait. A value of 0 returns immediately. A value of Forever blocks indefinitely.

Returns

true if the lock was acquired; otherwise, false.

Attributes

Exceptions

Remarks

When a lock is acquired, the behavior of the TryLock method is the same as the Lock method.

Applies to

See also