By calling:

snd(IEvent.create())

You are throwing away the value that is a function that can be used to raise the event. You need to say something like this (Originally posted to the F# mailing list by Don Syme):

type MyWidget = class

val tick : trigger<'a> * IEvent<'a>

new () = { tick = IEvent.create() }

// Trigger the event: often this member is hidden by a signature!

member x.OnMyEvent(ea) = (fst x.tick)(ea)

// Publish the event

member x.Tick = (snd x.tick)

end

let x = new MyWidget()

By on 8/16/2006 12:21 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper