Udostępnij za pośrednictwem


ShareDesktopButton Style and Template

This topic describes 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 Customizing Lync 2010 Controls.

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

Starts 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

Other Resources

Lync 2010 Controls

Lync 2010 Control Styles and Templates Reference

Customizing Lync 2010 Controls