'Controls'是未声明的前缀; XML无效

时间:2013-07-05 18:22:16

标签: wpf visual-studio-2010 xaml

所以这是我的xaml:

<Window x:Class="KinectButton.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Coding4Fun.Kinect.Wpf.Controls;assembly=Coding4Fun.Kinect.Wpf"
        Title="Weather" Height="1024" Width="1280" WindowStartupLocation="CenterScreen">
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="812*" />
            <ColumnDefinition Width="446*" />
        </Grid.ColumnDefinitions>
        <Canvas Background="#FF371780" Grid.ColumnSpan="2">
            <Controls:HoverButton Margin="0" Padding="0" x:Name="kinectButton" ImageSize="50"                                           
                                ImageSource="/Images/RightHand.png"  
                                ActiveImageSource="/Images/RightHand.png" 
                                TimeInterval="2000"  Panel.ZIndex="1000" Canvas.Left="0" Canvas.Top="0" />
            <Button x:Name="button1" Content="Close" Height="141" Canvas.Left="979" Canvas.Top="6" Width="273" Background="#FFFFF600" FontSize="53.333" Click="button1_Click" BorderThickness="4" Foreground="#FF1A1717" />
            <Label Canvas.Left="0" Canvas.Top="733" Content="" Height="1024" Name="message" Width="1280" Foreground="White" FontSize="40" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <Image Height="128" Name="videoStream" Stretch="Fill" Width="191" Canvas.Left="539" Canvas.Top="825" />
        </Canvas>
    </Grid>
</Window>

它不断给出错误: ''Controls'是未声明的前缀。第11行,第14行。' XML无效。

1 个答案:

答案 0 :(得分:5)

  1. Build - &gt; Clean Solution
  2. Build - &gt; Rebuild Solution
  3. 刚刚测试过你的XAML - 一切都是有效的,不应该造成任何问题。