Search code examples
c#wpfdockwindowsformshostlync-2010

Can I dock Lync SDK conversation on WPF without using winformshost?


I'm trying to build an application taking Lync SDK as a base, according to documentation on MSDN I need to dock the conversation windows on a winformshost.

But the problem here is winformshost is always on top, no opacity support, and a bit hard to play with. So doesn't seem like the best choice.

I was curious if there is another control that I can use?

For docking Lync uses these lines of code basically WindowsFormsHost.Child.Invoke() to dock and WindowsFormsHost.Child.Hide to undock;

delegate void DockConversationDelegate(string ConversationId);

myFormsHost.Child.Invoke(new DockConversationDelegate(DockTheConversation), 
      new object[] { _ConversationToDock });

public void WindowPanelHandle(string ConversationId, int PanelHandle)
{
   Microsoft.Lync.Model.Conversation.Conversation conversationToDock;
   if (myNewConversation.TryGetValue(ConversationId, out conversationToDock))
   {
       ConversationWindow cw = _automation.GetConversationWindow(conversationToDock);
       cw.Dock((IntPtr)PanelHandle);
    }
}

Every answer is appreciated! Thanks...


Solution

  • I don't believe this is possible, as the Conversation Window is a native window, as opposed to a WPF window. As the only way WPF has of using native windows/controls is via the WindowsFormsHost, then i'm pretty sure you're stuck with that.

    I'd love to be proved wrong though ;)