3

所以这是我的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 无效。

4

1 回答 1

6
  1. Build->Clean Solution
  2. Build->Rebuild Solution

刚刚测试了您的 XAML - 一切都是有效的,不会导致任何问题。

于 2013-07-05T18:51:24.223 回答