How to get current conversation in xbap hosted by lync cwe?

388 views Asked by At

I am implementing an extension of Lync conversation window(Lync cwe). Lync has an embedded browser, so I use xbap(WPF browser application) to display some information for this conversation. But I can't get the current conversation object in xbap code. Information about Lync CWE: http://msdn.microsoft.com/en-us/library/office/hh378589(v=office.14).aspx

I know that it is easy to achieve this in silverlight application by calling LyncClient.GetHostingConversation(). But for some reasons, I can't choose silverlight.

I found that Lync writes a key for every conversation in the browser. We can use javascript code to access the property: "external.Parameters". I also observe the method GetHostingConversation(), it uses HtmlPage.Window.Eval("external.Parameters") to get a key used to get the current conversation. But I don't know whether I can make use of this feature to get what I want in xbap.

I also tried to host an silverlight application in xbap. I hope that if I write the right information to the web browser control of xbap, then the silverlight application hosted in xbap can also get the current conversation object for me. But I failed to add external.Parameters. Information about hosting silverlight in xbap: http://msdn.microsoft.com/en-us/library/cc656722.aspx

Here is the steps I have made:

  1. Create a WPF browser application
  2. Add reference of Microsoft.Lync.Model and Microsoft.Lync.Utilities
  3. Use the following code to get the current conversation object:
    Conversation currentConversation = (Conversation)LyncClient.GetHostingConversation();

But visual studio told me LyncClient does not have a definition for GetHostingConversation.

So is it possible to get the current conversation object in xbap? And how?

Thanks.

1

There are 1 answers

0
user3076137 On

The GetHostingConversation method is only available in Lync Silverlight applications. It looks like you're using WPF. If WPF is required, you need to find out how to get the conversation object in a Lync WPF app. My memory is it's a bit more work than in a Silverlight application. You might consider posting a question on the Lync SDK forum, here:

http://social.msdn.microsoft.com/Forums/lync/en-US/home?forum=communicatorsdk