Home > Unhandled Error > Unhandled Error In Silverlight Application Invalid Cross-thread Access

Unhandled Error In Silverlight Application Invalid Cross-thread Access

asked 6 years ago viewed 42317 times active 1 year ago Visit Chat Linked 0 Invalid cross thread access in merging two model objects 25 Understanding the Silverlight Dispatcher 6 Silverlight Why does Wikipedia list an improper pronunciation of Esperanto? Silverlight in Sharepoint 2010 webpart Web Part Verbs in SharaPoint 2010 Web Part in Sharepoint 2010-AJAX based Timer Web P... Message: Unhandled Error in Silverlight Applicatio... Source

I was aware that the only code that needs to be on the UI thread is the OnPropertyChanged. Then a BitmapImage on the UI thread can set its source to the MemoryStream. I have tried instantiating BitmapImages on separate threads and it just doesn't work. but that would get hairy and I'm not even sure it would work. This Site

In the 'completed' callback I am updating an ObservableCollection that is bound to a combobox on the view. public void LoadThumbAsync(Stream src, WriteableBitmap bmp, object argument) { ThreadPool.QueueUserWorkItem(callback => { bmp.LoadJpeg(src); src.Dispose(); if (ImageLoaded != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { ImageLoaded(bmp, argument); }); } }); } But You have Regards, Victor the Telerik team Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate. Sep 27, 2010 11:15 AM|bhrugujani|LINK hay sorry to answer late , but i was just path error from my side, now i have approach live streaming stuff and i am encoding

Join them; it only takes a minute: Sign up Invalid cross-thread access in Silverlight app up vote 5 down vote favorite 1 I am using the Hammock framework to make asyncronous To switch back to the UI tread you need a handle on the Dispatcher. Browse other questions tagged c# silverlight multithreading silverlight-3.0 or ask your own question. If i change the event implementation to this, the exception is not thrown and the RadDiagnostics messagebox is shown : private void ApplicationBarIconButton_Click(object sender, EventArgs e) { throw new Exception("Test"); }

You may try instantiating the BitmapImages on the UI thread and then do everything else with the BitmapImage on another thread... You have to ensure that you return to the UI thread from your delegate before updating the UI. Why does Wikipedia list an improper pronunciation of Esperanto? http://stackoverflow.com/questions/1924408/invalid-cross-thread-access-issue Not the answer you're looking for?

Is there a formal way of saying 'hog'? at MS.Internal.XcpImports.CheckThread() at MS.Internal.XcpImports.MessageBox_ShowCore(String messageBoxText, String caption, UInt32 type) at System.Windows.MessageBox.ShowCore(String messageBoxText, String caption, MessageBoxButton button) at System.Windows.MessageBox.Show(String messageBoxText) at SilverlightApplication5.MainPage.Succeeded1(Object sender, ClientRequestSucceededEventArgs args) at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryGetResponseAsyncCallback(IAsyncResult more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation An 'Invalid cross-thread access' exception is being thrown in the 'OnPropertyChanged' event handler.

If the XAP is not present, this error can occur. 2) Objects in code and not being loaded correctly (this turned out to be the primary issue for my particular problem). http://www.sharepointsecurity.com/sharepoint/sharepoint-development/fix-unhandled-error-in-silverlight-2-application-invalid-cross-thread-access-error/ This can be done using the dispatcher: Deployment.Current.Dispatcher.BeginInvoke( () => { // update ui }); or (SomeDependencyObject).Dispatcher.BeginInvoke( () => { /* ... */ } ); Anyway, this code should be used We will investigate the issue and will fix it if possible. share|improve this answer edited Jul 20 '12 at 7:25 answered Jul 20 '12 at 7:08 Gene 2,69641538 add a comment| Your Answer draft saved draft discarded Sign up or log

Join them; it only takes a minute: Sign up Invalid cross-thread access issue up vote 26 down vote favorite 13 I have two ViewModel classes : PersonViewModel and PersonSearchListViewModel. this contact form One of the fields PersonViewModel implements is a profile image that is downloaded via WCF(cached locally in isolated storage). AWS EC2 SSH from my IP address which has changed What does this ice key do? Editing the bound object may force an update of the UI on the worker thread, which cannot succeed.

Post to Cancel Sharepoint Tutorials,Sharepoint 2010 Tutorials sharepoint 2010 tutorials, sharepoint articles, sharepoint basics, share point articles,sharepoint library, sharepoint client object model,sharepoint server object model, sharepoint bcs, sharepoint content types, sharepoint This is because it uses DependencyProperties, which can only be used on the UI thread. Which towel will dry faster? have a peek here You have to ensure that you return to the UI thread from your delegate before updating the UI.

Telerik is nominated in a total of 25 categories. I went with byte[] as a mean of storage. –Ender Dec 18 '09 at 14:59 this also helped me when I had to raise a PropertyChanged event for multiple But I did not think of putting BeginInvoke in there.

Events in Sharepoint 2010 Adding Features to Sharepoint site SharePoint Tutorials 2010 b Simple template.

The exact error was "Invalid cross-thread access". more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed The objects will not be initialized with this code, which can cause that particular error. Try using the 'Smooth Streaming Graphing Player' templateinstead.

If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.Would you like to participate? at MS.Internal.XcpImports.CheckThread() at System.Windows.Application.remove_UnhandledException(EventHandler`1 value) at Telerik.Windows.Controls.RadDiagnostics.f(Object A_0, ApplicationUnhandledExceptionEventArgs A_1) at MS.Internal.Error.CallApplicationUEHandler(Exception e) at MS.Internal.JoltHelper.OnUnhandledException(Object sender, UnhandledExceptionEventArgs args) Notice the Windows.controls.RadDiagnostics entry in the stacktrace. Browse other questions tagged .net silverlight thread-safety hammock or ask your own question. http://crimsonskysoftware.com/unhandled-error/unhandled-error-in-silverlight-application-1001.html Required fields are marked * Name * Email * Website Comment You may use these HTML tags and attributes:

If you delete your browser cache do you still see it?