2013-07-23 87 views
0

我正在开发基于Silverlight 5的应用程序。它的框架4.5是MVVM架构,由Prism实施。我也使用silverlight 5工具包。SilverLight 5工具包

<ResourceDictionary 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"        
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:system="clr-namespace:System;assembly=mscorlib" 
      xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" 
      xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" 
      xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
      xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
      xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" 
      xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input" 
      xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" 
      xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
      xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"  
      xmlns:telerikTabControl="clr-namespace:Telerik.Windows.Controls.TabControl;assembly=Telerik.Windows.Controls.Navigation" 
      xmlns:telerikNavigationPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls.Navigation" 
      xmlns:local="clr-namespace:UFone_CRM_UI.Themes" 
      xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Telerik_Windows_Controls_GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView" xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"> 

<ControlTemplate TargetType="controls:Calendar"> 
       <StackPanel x:Name="Root" HorizontalAlignment="Center" VerticalAlignment="Top"> 
        <controlsPrimitives:CalendarItem x:Name="CalendarItem" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" Style="{StaticResource System.Windows.Controls.Primitives.CalendarItem}" IsEnabled="True" /> 
       </StackPanel> 
      </ControlTemplate> 
<controlsPrimitives:DatePickerTextBox x:Name="TextBox" Margin="0,0,20,0" Height="22" Background="{TemplateBinding Background}" SelectionBackground="{TemplateBinding SelectionBackground}" BorderThickness="1,1,0,1" Foreground="{TemplateBinding Foreground}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Padding="{TemplateBinding Padding}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Style="{StaticResource System.Windows.Controls.Primitives.DatePickerTextBox}"/> 

该样品打造专业化successed但在InitializeComponent()方法运行时我得到这个误差=>

The type 'controlsPrimitives:CalendarItem' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built 
The type 'controlsPrimitives:DatePickerTextBox' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built 

如果删除控制,不会发生CalenderItem或DatePickerTextBox错误。

我该如何解决这个问题。

回答

0

您是否添加了对System.Windows.Controls的引用?