This project is read-only.
1
Vote

GetNetworkTypeAsync makes Blend crash

description

I'm using, in an MVVMLight application, the GetNetworkTypeAsync method to make sure I have a connection before displaying a button which lets you navigate to another page.
If I try to open the page in Blend, it makes Blend crash and outputs a textfile which goes like this :

System.UnauthorizedAccessException: Invalid cross-thread access.
at MS.Internal.XcpImports.CheckThread()
at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex)
at System.Windows.Threading.DispatcherTimer..ctor(UInt32 nativeTypeIndex)
at System.Windows.Threading.DispatcherTimer..ctor()
at System.Windows.Threading.Dispatcher..ctor()
at System.Windows.Threading.Dispatcher.get_MainDispatcher()
at AgiliTrain.PhoneyTools.Net.PhoneNetworking.CallbackNetworkType(GetNetworkTypePayload payload, NetworkType result) in D:\projects\PhoneyTools\PhoneyTools.Net\PhoneNetworking.cs:line 91
at AgiliTrain.PhoneyTools.Net.PhoneNetworking.<GetNetworkTypeAsync>b__1(Object wc) in D:\projects\PhoneyTools\PhoneyTools.Net\PhoneNetworking.cs:line 63
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

comments