WriteableBitmap.TryLock(Duration) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
timeout
is set to Automatic.
Remarks
When a lock is acquired, the behavior of the TryLock method is the same as the Lock method.
Applies to
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.