Monday, September 29, 2008

Presence the WPF way

Last time I described how to embed the presence controls onto a WPF form via the WindowsFormsHost control. Since some great things has happened. George Durzi at Clarity Consulting has released the presence controls for WPF. Its now more simple to implement presence in WPF. A persona list can be implemented like this.

<Window x:Class="NewUCControls.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:presence="clr-namespace:Microsoft.Samples.Office.UnifiedCommunications.PresenceControls;assembly=WPFMOCPresenceControls"

Title="Window1" Height="300" Width="300">
<Grid>
<presence:PersonaList Name="personaList1" Loaded="personaList1_Loaded" ShowDisplayName="True" ShowToolTip="True" ShowDetailedToolTipText="True" ShowContextMenu="True" ShowAvailability="True" />
</Grid>
</Window>

Loading personaslist is also easily done by:

List<string> sipURIs = new List<string>()
{
"someone1@somewhere.org",
"someone2@somewhere.org",
"someone3@somewhere.org",
};

personaList1.SipUris = sipURIs;

and the result will look something like this

image

No comments: