Note: this post is part of Lync Client development series. You can find the following topics here:
- Microsoft Lync Client Development,
- Sign in and out in Microsoft Lync Client,
- Lync Controls inside Lync Client SDK,
- Starting with Lync Client’s API,
- Handling some common scenarios with Lync Conversation,
- Handling transfers in Lync Client API,
- Handling conference calls in Lync Client,
- Availability (presence) in Lync Client.
This time let me present you the controls you have for use if you are building client application for Microsoft Lync. No matter which type of application and integration you are building, probably you are going to use some of them. Of course, if you are using the UI Suppression mode, which disables all UI controls of Lync, you won’t be using them. Let’s see how you can use them in your application:
So you can use them equally from the desktop or web application using WPF or Silverlight.
The controls you have in toolbar are the ones for presenting presence information (MyNoteBox, MyPresenceChooser, MyStatusArea, PresenceIndicator), for displaying list of contacts (ContactList, ContactCard, CustomContactList, CustomContactListItem), starting a variety of conversation types (StartAudioCallButton, StartInstantMessagingButton, StartVideoCallButton), performing a search of contacts (ContactSearch, ContactSearchInputBox, ContactSearchResultList), and some auxiliary functions (ScheduleMeetingButton, SendEmailButton, SendFileButton, ShareDesktopButton).
You just drag and drop them to window or page and controls will be automatically bound to the source of Lync. You don’t have to do anything about it. If you start the app, controls will automatically populate and give you an impression you are using the original Lync Client.
So, this was easy. Now, we are coming to a nifty part of the story: how can we remodel or customize those controls? Is there a way we could add or remove some of the functionalities that come out of the box? And, the most important, do these controls provide full functionality of Lync Client? Answers on these questions come in the following text.
Firstly, changing style and retemplating the controls is not such a big deal – you just follow the rules of applying custom style and template in XAML and you are good to go.
But what about changing the way internal data are presented? Can we do it? – Yes, we can. We can easily edit a copy of the existing template for the control we are customizing by using Microsoft Expression Blend 4. You opet a new project in Blend and drop the control on the surface. Create a new resource dictionary, which will be holding styles and templates for this action. Open the XAML file which contains the control which you wish to customize. On the View menu, click Active Document View and then click Design View. In the design view, right-click the control, click Edit Template, and then click Edit a Copy. In the Create Style Resource dialog box, enter a name for the style. Then, select the option to Define in Resource dictionary. Choose the dictionary you created earlier, and click OK. The dictionary you created will now be populated with a variety of Style resources that are used by the control you choose, as well as a copy of the existing style, having the name that you specified.
The answer for last question is unfortunatelly ‘not possible’. There is lot of things you can’t do by using Lync controls and this is something I hope will be mended in some of the future versions of Lync Client API. You don’t have those fency toolbar with contacts, history, feeds and dialpad (i.e. I have to create it from the scratch). You don’t have the Options menu, status bar on the bottom (with Call Forwarding, Audio settings, etc.), no support for Response Groups, etc. Very unfortunate!