ShareDesktopButton style and template

Beyond the basics topic

Learn about the style and template for the ShareDesktopButton control. You can modify the default ControlTemplate to give the control a unique appearance. For more information, see the other topics in the Customizing Lync Controls section.

Applies to: Lync 2013 | Lync Server 2013

There are no states or Style properties for the ShareDesktopButton control.

ShareDesktopButton Control

ShareDesktopButton parts

The following table lists the named parts for the ShareDesktopButton control.

Part

Type

Description

CommandControl

Control

Launches desktop sharing between the user who activated the control, and another user or group.

Default style and template

The following shows the XML namespace mapping that you have to specify when you work with styles and templates.

xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"

The following sample shows the default Windows Presentation Foundation style and template for the ShareDesktopButton control.

<Style x:Key="ShareDesktopButtonStyle1" TargetType="{x:Type controls:ShareDesktopButton}">
 <Setter Property="Template">
  <Setter.Value>
   <ControlTemplate TargetType="{x:Type controls:ShareDesktopButton}">
    <Microsoft_Lync_Controls_Internal:SplitButton Grid.Row="1" x:Name="PART_CommandControl" AutomationProperties.Name="Share desktop split button" Style="{StaticResource SplitButtonSecondaryWithoutDefaultStyle}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
     <Microsoft_Lync_Controls_Internal:SplitButton.DropDown>
      <Microsoft_Lync_Controls_Internal:ContextMenu ItemsSource="{TemplateBinding ContextInformationModels}" ItemContainerStyle="{StaticResource ShareDesktopMenuItemStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" />
     </Microsoft_Lync_Controls_Internal:SplitButton.DropDown>
     <ToolTipService.ToolTip>
      <ToolTip Style="{StaticResource DefaultToolTipStyle}" Content="{Binding Resources.ToolTipShareDesktop, Source={StaticResource ResourcesWrapper}}" />
     </ToolTipService.ToolTip>
     <Binding Path="Content" RelativeSource="{RelativeSource TemplatedParent}">
      <Binding.TargetNullValue>
       <ContentControl Style="{StaticResource IconStyle.StartShare}" />
      </Binding.TargetNullValue>
     </Binding>
    </Microsoft_Lync_Controls_Internal:SplitButton>
   </ControlTemplate>
  </Setter.Value>
 </Setter>
</Style>

See also

Customizing Lync Controls