Application strategies in Lync Controls applications

Application strategies in Lync Controls applications

Lync 2013

Core concepts

Learn about the application strategies used in developing Microsoft Lync 2013 Controls applications.

Last modified: February 22, 2013

Applies to: Lync 2013 | Lync Server 2013

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 is 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.

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

  1. Sign in to Microsoft Lync 2013.

  2. 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

  3. 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"
    
  4. 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>
    
    
  5. Build and run the 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

  1. Sign in to Lync 2013.

  2. 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

  3. 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"
    
  4. 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>
    
    
  5. Build and run the application.

Show:
© 2016 Microsoft