2013-07-19 69 views
0

製作一個WPF UI,有一個網格,一些行和文本塊。 繼承人CS爲XAMl;不明資源由URI

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
using System.Xaml; 
using Microsoft; 
using Microsoft.Expression; 
using Microsoft.Expression.Utility.ValueEditors; 
using IGotThis; 

namespace Project1 
{ 
    /// <summary> 
    /// Interaction logic for UserControl1.xaml 
    /// </summary> 
    public partial class UserControl1 : UserControl 
    { 
     public UserControl1() 
     { 
      InitializeComponent(); 
     } 
     void Page_Loaded(object sender, RoutedEventArgs e) 
     { 
      String[,] outlookArray = IGotThis.PullOutLookMessages.getOutlookMessages(); 
      this.OutLookInfo.DataContext = outlookArray; 
     } 
    } 

IGotThis是另一個CS,我認爲它是無關的。 每當我調試程序,我的WPF設計頁面被替換爲:

異常:組件「Microsoft.Expression.Utility.ValueEditors.SplitComboBox」不具有由URI「/微軟標識的資源。 Expression.Utility;組件/ valueeditors/splitcombobox.xaml」。

堆棧跟蹤

在System.Windows.Application.LoadComponent(對象部件,烏里resourceLocator) 的InnerException:無。

我絲毫不明白這個錯誤。在我的xaml代碼中, UserControl用藍色的蠕蟲標出了同樣的錯誤。

編輯:我的繼承人XAML

<UserControl x:Class="Project1.UserControl1" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     mc:Ignorable="d" Width="528" Height="556.4"> 
<Grid x:Name="OutLookInfo"> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="Auto" MinWidth="98"></ColumnDefinition> 
     <ColumnDefinition></ColumnDefinition> 
    </Grid.ColumnDefinitions> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="69*"></RowDefinition> 
     <RowDefinition Height="139*"></RowDefinition> 
     <RowDefinition Height="93*"></RowDefinition> 
     <RowDefinition Height="255*"></RowDefinition> 
    </Grid.RowDefinitions> 
    <TextBlock Text="Sender Name" HorizontalAlignment="Left" Height="22" Margin="0,23,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center"/> 
    <TextBlock Text="CC'd People" HorizontalAlignment="Left" Height="22" Margin="0,59,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="1"/> 
    <TextBlock Text="Subject" HorizontalAlignment="Left" Height="22" Margin="0,39,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="2"/> 
    <TextBlock Text="Body Text" HorizontalAlignment="Left" Height="22" Margin="0,112,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="98" FontSize="16" TextAlignment="Center" Grid.Row="3"/> 
    <TextBlock Text ="{Binding outlookArray}" Grid.Column="1" HorizontalAlignment="Left" Height="235" Margin="10,10,0,0" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Top" Width="410"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="71" Margin="10,10,0,0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="119" Margin="10,10,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
    <TextBlock Grid.Column="1" HorizontalAlignment="Left" Height="49" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="410" FontSize="18"/> 
</Grid> 

我不知道這是相關的,但我發現我的錯誤列表這樣的警告:

Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Expression.Utility, Version=5.0.30709.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. IGotThis 

我m不知道這意味着什麼,或者如何更改「目標處理器架構」

+0

它看起來像你正在使用的組件引用程序集 - 嘗試添加對「Microsoft.Expression.Utility.dll」的引用? – McGarnagle

+0

那個位置在哪裏?我查看了添加引用中的每個選項卡,它並沒有位於那裏,如果我嘗試使用using語句,它會給我一個沒有引用的錯誤。 –

+0

進行了手動搜索,發現了帶有Microsoft.Expression.Utility的.dll文件,但添加後告訴我他們已經被引用。 –

回答

0

修正了它。我認爲可能必須這樣做,我試圖在控制檯應用程序中運行WPF。我切換了,現在不會有任何錯誤。

+0

請詳細說明。你是怎麼做到的? –