Jump to content

WPF - react on incoming calls - Threading Problem


juse

Recommended Posts

Hello,

 

I try to implement the following into a custom crm wpf (VB.NET) application: seach for a person with the number that is just calling and show his person.

 

With the samples I managed to create a method that reacts on the fired event of the clientlinemgr.

But the SDK Interop.CLMBGLib.DLL unfortunately seems to create a new Thread and no matter what I do, I'm in the wrong Thread now and I get errors.

That is a problem, because I need to call functions that show user controls in a window etc. and in WPF I need to do that on the Application STA Thread.

There is only this one thread allowed in WPF to operate with UI components. Is there any chance to acomplish my task, anyway?

I added my sample to this post.

 

Thanks in advance for any help!

 

 

 

 

mysample.vb

Link to comment
Share on other sites


Hey Juse,

 

I had a problem like yours. Can you solve it by invoking the WPF class? I just know it by Windows Forms...

 

Example for my Invoking from an other thread:

                 this.Invoke(new Action(() =>
                    {
                        label8.Text = myNetPhoneClient.UserName;
                        SetUserStateOn();
                    }));

 

Link to comment
Share on other sites


  • 2 weeks later...

Thank you for your input! :)

I tried using Dispatcher.Invoke (via DispatcherHelper from MVVM Light) and after I intialized the DispatcherHelper correctly, it finally does what I wanted!

 

 

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.