<Window x:Class="WPF熊俊.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xj="clr-namespace:WPF1"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<xj:Student x:Key="mystudent" age="25"></xj:Student>
</Window.Resources>
<StackPanel>
</StackPanel>
</Window>
上面的代码,引用了本项目的名称空间,本项目有个Student类,但为什么实例化的时候,要报错呢:未到类型“xj:Student”。请确保不缺少程序集引用,并且已生成所有引用的程序集。为什么报错?
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xj="clr-namespace:WPF1"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<xj:Student x:Key="mystudent" age="25"></xj:Student>
</Window.Resources>
<StackPanel>
</StackPanel>
</Window>
上面的代码,引用了本项目的名称空间,本项目有个Student类,但为什么实例化的时候,要报错呢:未到类型“xj:Student”。请确保不缺少程序集引用,并且已生成所有引用的程序集。为什么报错?
public class Student
{
...
}
{
public class Student
{
...
}
}
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:xj="clr-namespace:WPF熊俊"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<sys:DateTime x:Key="dt">10/25/2012 4:20 PM</sys:DateTime>
<xj:Student></xj:Student>
</Window.Resources>
<StackPanel>
</StackPanel>
</Window>
全部代码是这样的,为什么报错呢?
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:xj="clr-namespace:WPF熊俊"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<sys:DateTime x:Key="dt">10/25/2012 4:20 PM</sys:DateTime>
<xj:Studentt x:Key="st"></xj:Student>
</Window.Resources>
<StackPanel>
</StackPanel>
</Window>
全部代码是这样的,为什么报错呢?