Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8708105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:02:31+00:00 2026-06-13T04:02:31+00:00

I want warn my page that the transmitted data is completed. I create object,

  • 0

I want warn my page that the transmitted data is completed. I create object, add event handler and call new Thread for async transmitted data to server. When data transmitted, and recive from server answer i callback my event, but throw exception ‘invalid cross-thread access’.
Why don’t run my event handler?

// My page (PhoneApplicationPage)
public partial class PageStart
{
     private void btn_Send_Click(object sender, RoutedEventArgs e)
     {
          TransmitHolder holder = new TransmitHolder();
          holder.onCompleted += new TransmitHolder.CompleteHandler(onCompleted);
          // transmit async
          new Thread(delegate() { Transmitter(holder).Start(); }).Start();
     }

     private void onCompleted(object sender, byte[] answer)
     {
          //some code
     }
}

public class TransmitHolder
{
     public delegate void CompleteHandler(object sender, byte[] answer);
     public event CompleteHandler onCompleted;

     public void Complete(byte[] answer)
     {
         if (onCompleted != null)
         {
             onCompleted(null, answer); // here throw exception `invalid cross-thread access`
         }
     }
}

public class Transmitter
{
    private TransmitHolder holder;

    public Transmitter(TransmitHolder holder)
    {
         this.holder = holder;
    }

    // send data from server
    public void Start()
    {
         // send data using soket
         NetworkManager nm = new NetworkManager();
         // method Send execute Connect, Send and Recive data from server
         byte[] answer = nm.Send(Encoding.UTF8.GetBytes("hello_word"));
         holder.Complette(answer); // notify, send data completed
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:02:33+00:00Added an answer on June 13, 2026 at 4:02 am

    On the Windows Phone 7 Platform, all the UI logic should be done on the UI Thread. If you attempt to change the visual tree, or set/get a property of a DependencyObject (all the UI elements are DependencyObject(s) ) on a thread different thant the dedicated UI thread, you will get an Invalid Cross thread exception.

    To perform UI logic on the right thread, use the adequate dispatcher.

    Deployment.Current.Dispatcher.BeginInvoke(() => { <Put your UI logic here> }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to delete a some data in a page and want to warn
I am trying warn user to save data if he wants leave the page.
I've got a page that should warn if the user tries to leave the
I want to warn users of Internet Explorer 6 using my site, that IE6
I have a DataGridTemplateColumn with DataTemplate as a PasswordBox. I want to warn user
If the user refreshes the page in question it will add another record to
I want to warn the user when memory available is low. Currently I'm using
I want my error page of my seam application to redirect to the home
I want to be able to return all of the parameters that are being
I am working with the Spreadsheet::ParseExcel module. I want to create a hash of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.