I tried following the example given on MSDN, but my code does not compile on the compact framework. It does compile on the normal framework, though.
type StorageComponent(game) =
inherit GameComponent(game)
let title_storage_acquired_event = new Control.DelegateEvent<StorageEventHandler>()
Error message:
The type ‘DelegateEvent’ is not defined
Based on the hint from Brian, it looks that the types
DelegateEvent<'Delegate>andEvent<'Delegate, 'Args>are not supported on .NET Compact Framework. This would mean that you cannot declare an event that uses an explicitly specified delegate type.However, you can still use the
Event<'T>type which creates an event of typeHandler<'T>(which is a generic delegate type representing methods with two parameters of typesobjand'T):Assuming that the declaration of
StorageEventHandlerlooks like this:The example above should create more or less an equivalent code (with the only difference that it uses generic
Handler<_>delegate type instead of your ownStorageEventHandler).