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:
- Create a WPF browser application
- Add reference of Microsoft.Lync.Model and Microsoft.Lync.Utilities
- 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.