In F#, events are represented as IEvent<T> values which inherit from IObservable<T> and so they are just ordinary values - not a special language construct.
You can register a handler using the Add method:
type LegoExample() =
let brick = Brick(BluetoothCommunication("COM3"))
do brick.Changed.Add(fun e ->
// some logic goes here...
)
You need the do keyword here if you want to register the handler inside the constructor of LegoExample.
Alternatively, you can also use various functions from the Observable module - those implement basic functionality similar to the one provided by Rx:
type LegoExample() =
let brick = Brick(BluetoothCommunication("COM3"))
do brick.Changed
|> Observable.filter (fun e -> ...)
|> Observable.add (fun e ->
// some logic goes here...
)