我更新了現有的應用程序,它使用lync sdk程序集silverlight 5.從那裏開始,應用程序不會編譯出錯誤 標記'UCTreeView'不存在於XML命名空間'CLR-名稱空間:Microsoft.Lync.Controls;裝配= Microsoft.Lync.Controls' 我已經添加下列參考文獻 Microsoft.Lync.ControlsLync 2010 SDK問題與Silverlight 5
Microsoft.Lync.Controls.Framework
Microsoft.Lync .Model
Microsoft.Lync.Utilit IES
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>
你有問題嗎? – jv42 2012-03-14 16:57:26
更嚴重的是,您似乎需要Microsoft提供的更新的Lync SDK。也許在Connect https://connect.microsoft.com/VisualStudio上打開一個問題 – jv42 2012-03-14 17:00:38