I cant get the dispatchtimer to work in vb.net.

I want the MainGameLoop() code to run every 20MS after i click abutton but this doesnt do that.



Dim dt As DispatcherTimer

Private Sub mybutton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles mybutton.Click
dt = New DispatcherTimer
dt.Interval = TimeSpan.FromMilliseconds(20)

' Dim MainGameLoop As EventHandler

' AddHandler dt.Tick, MainGameLoop
MainGameLoop() 'just runs once

End Sub



Private Sub MainGameLoop()