2013-07-23 89 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的引用?