Application Strategies in Lync Control Applications_

[This is preliminary documentation and is subject to change.]

Use Microsoft Lync Controls to add presence and availability information on colleagues, customers, and vendors to your new or existing applications. This topic identifies the basic strategies for adding presence to Microsoft Windows Presentation Foundation (WPF), and Microsoft Silverlight applications.

Lync Control applications require the user to sign in to Microsoft Lync 2013 Preview. Each Lync Controls application connects to Microsoft Lync Server 2013 Preview using a single out-of-process connection to Lync 2013 Preview. The application is either a WPF or Silverlight application containing Lync Controls.

For Windows Forms and WPF applications it is common to use one thread for UI, and a separate thread for tasks such as database access or asynchronous network calls. 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 then add XAML code to create the Lync Controls.

To add Lync Controls to an existing WPF application

  1. Sign in to Microsoft Lync 2013 Preview.

  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 will add a MyStatusArea control. For more information, see How to: Publish Presence.

    <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 then add XAML code to create the Lync Controls.

To add Lync Controls to an existing Silverlight application

  1. Sign in to Lync 2013 Preview.

  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 Preview 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 will add a MyStatusArea control. For more information, see How Do I in Lync Controls.

    <StackPanel>
      <controls:MyStatusArea PhotoDisplayMode="Small"/>
    </StackPanel>
    
    
  5. Build and run the application.

Community Additions

Show:
© 2014 Microsoft