Thread Freezing in VB

Topics: WPF
Sep 25, 2012 at 6:44 PM
Edited Sep 25, 2012 at 6:45 PM

Im using the maps in an application and I'm having a bit of trouble with the Application completely locking up while moving around with the tiles.

I looked at the WPF Example and Several discussions but I can't get this working

Im using


    Private Sub Map_OnTileLoadComplete(ByVal elapsedmiliseconds As Long) Handles Map.OnTileLoadComplete

        Dim m As Forms.MethodInvoker = AddressOf HidePleaseWait

        Map.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, m)

    End Sub

    Private Sub Map_OnTileLoadStart() Handles Map.OnTileLoadStart
        Dim m As Forms.MethodInvoker = AddressOf ShowPleaseWait

        Map.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, m)

    End Sub

    Public Sub ShowPleaseWait()
        Me.mapsProgress.Visibility = Windows.Visibility.Visible
    End Sub

    Public Sub HidePleaseWait()
        Me.mapsProgress.Visibility = Windows.Visibility.Hidden
    End Sub


But It still seems to lock up my application. Im using VB and its difficult to translate the C# code but the above should work. Are there any hints to what I can do to make this work?

Is there anything else that needs to be set so this doesn't happen?

I tried loading the same bits of maps under the WPF demo and they work perfect.

PS Ive also tried swapping out Me.Dispatcher and Maps.Dispatcher to no avail

Sep 25, 2012 at 6:59 PM
Edited Sep 25, 2012 at 7:02 PM

try set lowest DispatcherPriority

p.s. i used try/catch block, don't remember why, but you can try it too ;}

Sep 25, 2012 at 7:19 PM

I gave that a shot, It didn't help too much. I tried Background. It was a bit better but still not as good as the WPF Demo

Anything else I can do?

Sep 25, 2012 at 7:28 PM

add  try/catch block

Sep 25, 2012 at 7:38 PM

The catch block didnt do much, there weren't errors without it before

Sep 25, 2012 at 8:13 PM

hm, thats strange, and the demo works fine using identical code, can you zip your test project and share it somewhere? ;/