我已将使用 lync sdk 程序集的现有应用程序更新到 silverlight 5。从那里开始,应用程序无法编译给出错误 XML 命名空间 'clr-namespace:Microsoft.Lync.Controls; 中不存在标签'UCTreeView'; assembly=Microsoft.Lync.Controls' 我添加了以下参考 Microsoft.Lync.Controls
Microsoft.Lync.Controls.Framework
Microsoft.Lync.Model
Microsoft.Lync.Utilities
System.Windows.Controls
以下 XAML 给出了编译错误
<UserControl x:Class="aa.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:controls="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
mc:Ignorable="d"
xmlns:Microsoft_Lync_Controls_Internal_Converters="clr-namespace:Microsoft.Lync.Controls.Internal.Converters;assembly=Microsoft.Lync.Controls"
xmlns:Microsoft_Lync_Internal_Utilities_Helpers="clr-namespace:Microsoft.Lync.Internal.Utilities.Helpers;assembly=Microsoft.Lync.Utilities"
xmlns:Microsoft_Lync_Controls_Internal="clr-namespace:Microsoft.Lync.Controls.Internal;assembly=Microsoft.Lync.Controls"
xmlns:Microsoft_Lync_Controls_Internal_Framework_Commands="clr-namespace:Microsoft.Lync.Controls.Internal.Framework.Commands;assembly=Microsoft.Lync.Controls.Framework"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<Style x:Key="ContactListStyle1" TargetType="controls:ContactList">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Microsoft_Lync_Internal_Utilities_Helpers:SetterValueBindingHelper.PropertyBindingCollection">
<Setter.Value>
<Microsoft_Lync_Internal_Utilities_Helpers:SetterValueBindingHelperCollection>
<Microsoft_Lync_Internal_Utilities_Helpers:SetterValueBindingHelper Binding="{Binding DefaultControlBackgroundBrush, Source={StaticResource ControlColors}}" Property="Background"/>
</Microsoft_Lync_Internal_Utilities_Helpers:SetterValueBindingHelperCollection>
</Setter.Value>
</Setter>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="UseLayoutRounding" Value="False"/>
<Setter Property="AllowDrop" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:ContactList">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<Grid x:Name="PART_ContactListGrid" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid AutomationProperties.AutomationId="PivotBar" Visibility="{Binding ShowPivotBar, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Grid Height="26" Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=PivotBarDivider}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton AutomationProperties.AutomationId="ViewByGroupButton" Content="{Binding Resources.ContactListFilterGroup, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}" Grid.Column="0" GroupName="ViewByOptions" IsChecked="{Binding GroupViewBySetting, ConverterParameter=Groups, Converter={StaticResource EnumToBoolConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{Binding IsSignedIn, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ListFilterRadioButtonStyle}">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Resources.ContactListFilterGroupToolTip, Source={StaticResource ResourcesWrapper}}" Style="{StaticResource DefaultToolTipStyle}"/>
</ToolTipService.ToolTip>
</Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton>
<Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton AutomationProperties.AutomationId="ViewByStatusButton" Content="{Binding Resources.ContactListFilterStatus, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}" Grid.Column="1" GroupName="ViewByOptions" IsChecked="{Binding GroupViewBySetting, ConverterParameter=Status, Converter={StaticResource EnumToBoolConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{Binding IsSignedIn, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ListFilterRadioButtonStyle}">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Resources.ContactListFilterStatusToolTip, Source={StaticResource ResourcesWrapper}}" Style="{StaticResource DefaultToolTipStyle}"/>
</ToolTipService.ToolTip>
</Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton>
<Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton AutomationProperties.AutomationId="ViewByRelationshipButton" Content="{Binding Resources.ContactListFilterRelationship, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}" Grid.Column="2" GroupName="ViewByOptions" IsChecked="{Binding GroupViewBySetting, ConverterParameter=Relationship, Converter={StaticResource EnumToBoolConverter}, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{Binding IsSignedIn, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ListFilterRadioButtonStyle}">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Resources.ContactListFilterRelationshipToolTip, Source={StaticResource ResourcesWrapper}}" Style="{StaticResource DefaultToolTipStyle}"/>
</ToolTipService.ToolTip>
</Microsoft_Lync_Controls_Internal:EnterEnabledRadioButton>
<Microsoft_Lync_Controls_Internal:SplitButton x:Name="PART_ViewLayoutMenu" AutomationProperties.AutomationId="ViewLayoutMenu" Grid.Column="3" HorizontalAlignment="Right" Height="22" IsEnabled="{Binding IsSignedIn, RelativeSource={RelativeSource TemplatedParent}}" Padding="2,0,2,0" Style="{StaticResource SplitButtonControlTertiaryStyle}" VerticalAlignment="Center">
<Microsoft_Lync_Controls_Internal:SplitButton.DropDown>
<Microsoft_Lync_Controls_Internal:ContextMenu>
<Microsoft_Lync_Controls_Internal:RadioMenuItem x:Name="PART_OneLineMenuItem" AutomationProperties.AutomationId="OneLineRadioButton" GroupName="LineViewGroup" Header="{Binding Resources.ContactListViewOneLine, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}">
<Microsoft_Lync_Controls_Internal:RadioMenuItem.Icon>
<ContentControl Style="{StaticResource IconStyle.OneLineView}"/>
</Microsoft_Lync_Controls_Internal:RadioMenuItem.Icon>
</Microsoft_Lync_Controls_Internal:RadioMenuItem>
<Microsoft_Lync_Controls_Internal:RadioMenuItem x:Name="PART_TwoLinesMenuItem" AutomationProperties.AutomationId="TwoLinesRadioButton" GroupName="LineViewGroup" Header="{Binding Resources.ContactListViewTwoLine, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}">
<Microsoft_Lync_Controls_Internal:RadioMenuItem.Icon>
<ContentControl Margin="0,1,0,0" Style="{StaticResource IconStyle.TwoLineView}"/>
</Microsoft_Lync_Controls_Internal:RadioMenuItem.Icon>
</Microsoft_Lync_Controls_Internal:RadioMenuItem>
<Microsoft_Lync_Controls_Internal:MenuItem Header="{Binding Resources.ContactListViewShowFriendlyName, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}" IsCheckable="True" IsChecked="{Binding ShowFriendlyName, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<Microsoft_Lync_Controls_Internal:MenuItem IsTabStop="False" IsEnabled="False" Style="{StaticResource MenuItemSeparatorStyle}"/>
<Microsoft_Lync_Controls_Internal:RadioMenuItem x:Name="PART_SortByDisplayNameMenuItem" GroupName="SortByGroup" Header="{Binding Resources.ContactListViewDisplayName, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}"/>
<Microsoft_Lync_Controls_Internal:RadioMenuItem x:Name="PART_SortByAvailabilityMenuItem" GroupName="SortByGroup" Header="{Binding Resources.ContactListViewAvailability, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}"/>
<Microsoft_Lync_Controls_Internal:MenuItem IsTabStop="False" IsEnabled="False" Style="{StaticResource MenuItemSeparatorStyle}"/>
<Microsoft_Lync_Controls_Internal:MenuItem Header="{Binding Resources.ContactListViewShowFrequentContacts, Converter={StaticResource StringToAcceleratorConverter}, Source={StaticResource ResourcesWrapper}}" IsCheckable="True" IsChecked="{Binding ShowFrequentContacts, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
</Microsoft_Lync_Controls_Internal:ContextMenu>
</Microsoft_Lync_Controls_Internal:SplitButton.DropDown>
<Microsoft_Lync_Controls_Internal:SplitButton.LeftToolTip>
<ToolTip Content="{Binding Resources.ToolTipContactListLayoutMenuLeft, Source={StaticResource ResourcesWrapper}}" Style="{StaticResource DefaultToolTipStyle}"/>
</Microsoft_Lync_Controls_Internal:SplitButton.LeftToolTip>
<Microsoft_Lync_Controls_Internal:SplitButton.RightToolTip>
<ToolTip Content="{Binding Resources.ToolTipContactListLayoutMenuRight, Source={StaticResource ResourcesWrapper}}" Style="{StaticResource DefaultToolTipStyle}"/>
</Microsoft_Lync_Controls_Internal:SplitButton.RightToolTip>
<Grid>
<ContentControl Style="{StaticResource IconStyle.OneLineView}" Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=PART_OneLineMenuItem, FallbackValue=Collapsed, Mode=OneWay}"/>
<ContentControl Style="{StaticResource IconStyle.TwoLineView}" Visibility="{Binding IsChecked, Converter={StaticResource NotBooleanToVisibilityConverter}, ElementName=PART_OneLineMenuItem, Mode=OneWay}"/>
</Grid>
</Microsoft_Lync_Controls_Internal:SplitButton>
</Grid>
<ToggleButton x:Name="PivotBarDivider" AutomationProperties.AutomationId="PivotBarDivider" Height="10" IsChecked="True" AutomationProperties.Name="Pivot bar divider" Grid.Row="1" Style="{StaticResource ToggleButtonPivotDividerStyle}"/>
</Grid>
<controls:UCTreeView x:Name="PART_TreeControl" ContextualInformation="{TemplateBinding ContextualInformation}" ContactLayoutView="{TemplateBinding ContactLayoutView}" GroupViewBySetting="{TemplateBinding GroupViewBySetting}" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" ItemsSource="{TemplateBinding Contacts}" IsEnabled="{TemplateBinding IsSignedIn}" Grid.Row="1" ShowFriendlyName="{TemplateBinding ShowFriendlyName}" ScrollViewer.VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" Style="{StaticResource UCTreeViewStyle1}"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>