URI的未识别资源

时间:2013-07-19 19:42:33

标签: c# wpf xaml

制作WPF UI,有网格,一些行和文本块。 继承了XAMl的CS;

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;
        }
    }

IGot这是另一个CS,我认为它是无关的。 每当我调试程序时,我的WPF设计器页面都会被替换为:

  

异常:组件'Microsoft.Expression.Utility.ValueEditors.SplitComboBox'没有由URI标识的资源'/Microsoft.Expression.Utility ;component/valueeditors/splitcombobox.xaml'。

     

栈跟踪

     

在System.Windows.Application.LoadComponent(对象组件,Uri 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

我不确定这意味着什么,或者如何更改“目标处理器架构”

1 个答案:

答案 0 :(得分:0)

修正了它。我认为可能必须这样做,我试图在控制台应用程序中运行WPF。我换了,现在没有任何错误。

相关问题