I want to ask a simple question how to stop this timer.
Somebody's code is like this :
let mutable timer = new DispatcherTimer()
timer.Interval - new TimeSpan(0,0,0,0,100)
timer.Start()
and I want to add a function that cause the timer to stop whenever I click button
So I put a code like this (I don't really have a clue) :
btnStop.Click
|> Event.add(fun args -> timer.Stop())
but it says that it cannot be captured by closure
any idea how to do this?
sorry. I am not an experienced functional programmer. I just want to modify a code.