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 6113749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:53:41+00:00 2026-05-23T14:53:41+00:00

I have been developing a Lync Silverlight application in Silverlight and now I am

  • 0

I have been developing a Lync Silverlight application in Silverlight and now I am trying to shift it to WPF.

However, I am facing some thread affinity issues. For example I display the Lync client’s state on my page in a textblock, and so in my code behind have wired a state changed event handler, that writes the new state into the textblock whenever the state of Lync client changes.

Now, this worked perfectly in silverlight but seemingly is not allowed in WPF.
Now my questions are:

  1. How come it works in Silverlight bt not in WPF, even though Silverlight is supposed to be a subset of WPF?

  2. Thread affinity is an important concept and I know we can use invoke dispatcher, but doesn’t it just beat the concept of asynchronous programming in form of event handlers and callbacks?

  3. I have a button defined in my XAML page, and the click event handler defined on it can access other UI elements, it does not suffer the problem outlined above.

    But if I define a LyncClient instance in my code-behind, event handlers defined on it cannot access the UI elements. Why so, I detected no such difference between UIElements and other objects in Silverlight?

  • 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-05-23T14:53:42+00:00Added an answer on May 23, 2026 at 2:53 pm

    Based on above comments, I’ll suggest the following “answer”…

    I would guess it is more likely than not that there is some sort of different in the way that the SL API was written than that of the WPF api. That could explain the difference in the thread that is used when the API issues the callback. To verify this, you could:

    1. Ask MS directly
    2. Put some diagnostics code in your callback method to log the thread ID and compare that to the main thread of the application. Do this for both SL and WPF to see if they are the same or different threads.
    3. Open the assemblies in Reflector to inspect how each API was written.

    In terms of handling this specific situation, in your callback, you could:

    1. Get the dispatcher object (different for SL than WPF) and always issue UI updates through Dispatcher.Invoke.
    2. Use databinding and INotifyPropertyChanged to insulate the UI from the property. You could delcare a property on a ViewModel or in the code behind. Then bind the UI’s textbox to that property. Databinding has some smarts in it that will automatically marshal property changes to the correct thread (in most cases anyway).

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

App Store We have been developing an app for quite some time now for
I have been developing websites for a couple of years now and I almost
I have been developing a C# windows form application in XP. It all works
Up till now I have been developing my personal and school projects at home
I have been developing Android application since 3 to 4 months. I am naive,
I have been developing an application in asp.net mvc3. We have used models to
People have been developing own solutions to the following problems: Consistent messaging frameworks for
I have been developing in asp.net since its existence (also classic asp before that)
I have been developing with Java for several years and last six months I
There are several people about (myself being one of them) who have been developing

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.