AsyncCompletedEventArgs::Cancelled Property
Gets a value that indicates whether an asynchronous operation has been canceled.
Namespace: System.ComponentModel
Assembly: System (in System.dll)
Property Value
Type: System::Booleantrue if the asynchronous operation has been canceled; otherwise, false. The default is false.
When the Cancelled property is true, the asynchronous operation was interrupted.
The client application's event-handler delegate should check the Cancelled property before accessing any properties in a class derived from AsyncCompletedEventArgs; otherwise, the property will raise an InvalidOperationException if the asynchronous operation was interrupted.
Notes to InheritorsIf you provide read-only properties in a derived class, make sure that you call the RaiseExceptionIfNecessary method. This prevents clients from accessing properties that are potentially not valid because of a failure in the asynchronous operation.
The following code example demonstrates the using the Cancelled property to inform a client that an asynchronous operation was canceled. The property is not referenced by name in this example, but the value for it is passed in to the AsyncCompletedEventArgs constructor. This code example is part of a larger example provided for the System.ComponentModel::AsyncOperationManager class.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.