Welcome to our blog on the topics that we find interesting in our work life.

Sunday, August 24, 2008

Communicator Presence Controls in WPF

Last night I was preparing some ideas for a demo application I need later this week. The demo app had to look good and should be fun and interesting in the making. So I decided to code the UI in Windows Presentation Foundation (WPF). Code in XAML for WPF is simple and one will soon get the hang of it. So I went using some ListViews filled with data via LINQ to SQL and a data class. When I came to implementing Office Communicator 2007 functionality I realized that the “Microsoft Office Communicator 2007 Presence Controls” did only exists as Windows Forms User Controls and not as WPF user controls. Facing the choice of coding my own controls or try to make use of the existing Win Form controls I browsed around and found a XAML tag which enables you to host a windows forms control on a WPF page and the great part about it is really easy to use:

Download the above mentioned controls from Microsoft and install them.

Include the managed controls into you WPF project solution.

Add the WindowsFromHost tag to the WPF XAML page.

Add the necessary XML name spaces. Look for xmlns:q1 and xmlns:q2 in the example below

1 comment:

Josh Kunken
said...

According to the Readme file, Communicator must be installed on the workstation running the client app for the controls to appear. Major bummer... would be good if only MSN Messenger were necessary at a minimum.