ContextItemManager.RemoveCallback Method
A helper method that performs a Delegate.Remove, but knows how to unwrap delegates that are proxies to generic callbacks.
Namespace: Microsoft.Windows.Design
Assembly: Microsoft.Windows.Design (in Microsoft.Windows.Design.dll)
Syntax
'Declaration
Protected Shared Function RemoveCallback ( _
existing As Delegate, _
toRemove As Delegate _
) As Delegate
'Usage
Dim existing As [Delegate]
Dim toRemove As [Delegate]
Dim returnValue As [Delegate]
returnValue = ContextItemManager.RemoveCallback(existing, _
toRemove)
protected static Delegate RemoveCallback(
Delegate existing,
Delegate toRemove
)
protected:
static Delegate^ RemoveCallback(
Delegate^ existing,
Delegate^ toRemove
)
protected static function RemoveCallback(
existing : Delegate,
toRemove : Delegate
) : Delegate
Parameters
existing
Type: System.DelegateThe existing delegate.
toRemove
Type: System.DelegateThe delegate to be removed from existing.
Return Value
Type: System.Delegate
The new delegate that should be assigned to existing.
Remarks
Use RemoveCallback in your Unsubscribe implementations.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design Namespace
SubscribeContextCallback<ContextItemType>