Application strategies in Lync Controls applications
Learn about the application strategies used in developing Microsoft Lync 2013 Controls applications.
Applies to: Lync 2013 | Lync Server 2013
In this article |
Application strategy overview
Use Microsoft Lync Controls to add presence and availability information about Lync users and PIC users to your new or existing applications. Lync Controls such as the StartInstantMessagingButton control provide a one-click way to start a conversation with Lync user or PIC user
Lync Control applications require the user to sign in to Microsoft Lync 2013. A Lync Controls application connects to Lync Server 2013 through a single out-of-process connection to Lync 2013. The out-of-process connection to the Lync client endpoint logic enables the custom window to have a lightweight memory and process footprint.
The application is a WPF or Silverlight window that contains Lync Controls and may also have custom logic. For Windows Forms and WPF applications, it's common to use one thread for the UI and a separate thread for tasks such as database access or other asynchronous operations. However, in Silverlight Lync Controls applications, keep all application logic in the UI thread. For event handling in Silverlight Lync Controls applications, you must marshal relevant event data to your UI thread using something like Dispatcher.Invoke. To do otherwise raises a cross-thread exception.
Add presence to an existing WPF application
To add Lync Controls to an existing WPF application, add project references for the Lync Control DLLs and add XAML code to create the Lync Controls.
To add presence to an existing WPF application
Sign in to Microsoft Lync 2013.
In Microsoft Visual Studio, add project references to the WPF versions of the following libraries:
Microsoft.Lync.Controls.dll
Microsoft.Lync.Controls.Framework.dll
Microsoft.Lync.Model.dll
Microsoft.Lync.Utilities.dll
On the appropriate XAML page, add the following XAML text to declare the Lync Controls namespace.
xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
Author the appropriate XAML code to add the Lync Controls. For example, the following XAML adds a MyStatusArea control.
For more information, see How to: Create a Silverlight page that displays a Lync presence control.
<StackPanel> <controls:MyStatusArea PhotoDisplayMode="Small"/> </StackPanel>
Build and run the application.
Add presence to an existing Silverlight application
To add Lync Controls to an existing Silverlight application, add project references for the Lync Control DLLs and add XAML code to create the Lync Controls.
To add presence to an existing Silverlight application
Sign in to Lync 2013.
Add project references to the Silverlight versions of the following libraries:
Microsoft.Lync.Controls.dll
Microsoft.Lync.Controls.Framework.dll
Microsoft.Lync.Model.dll
Microsoft.Lync.Utilities.dll
On the appropriate XAML page, add the following XAML text to declare the Lync 2013 namespace.
xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
Author the appropriate XAML code to add the Lync Controls. For example, the following XAML adds a MyStatusArea control.
For more information, see What you can do with Lync Controls.
<StackPanel> <controls:MyStatusArea PhotoDisplayMode="Small"/> </StackPanel>
Build and run the application.