开发者

The tag 'CardGUIUserControlWpf' does not exisrt in XML namespace 'clr-namespace:CardGameControls;assembly=CardGameControls'. Line 14 Pos 14

The tag 'CardGUIUserControlWpf' does not exisrt in XML namespace 'clr-namespace:CardGameControls;assembly=CardGameControls'. Line 14 Pos 14

The error occurs in the clas PlayerGUI.xaml .

PlayerGUI is a UserControl. It contains another UserControl named CardGUIUserControlWpf.

I attach the code:

         <UserControl x:Class="CardGameControls.PlayerGUI"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/marku开发者_如何学运维p-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:MyControl="clr-namespace:CardGameControls;assembly=CardGameControls"
             mc:Ignorable="d" xmlns:my="clr-namespace:CardGameControls;assembly=CardGameControls">
    <Grid Height="152" Width="385">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="80*" />
            <ColumnDefinition Width="305*" />
        </Grid.ColumnDefinitions>
        <StackPanel Height="100" HorizontalAlignment="Left" Margin="8,12,0,0" Name="stackPanelPlayer" VerticalAlignment="Top" Width="342" Panel.ZIndex="1" Background="#E6F5EFEF" Grid.ColumnSpan="2" Orientation="Horizontal">
            <my:CardGUIUserControlWpf x:Name="cardGUIUserControlWpf1" Loaded="cardGUIUserControlWpf1_Loaded" />
        </StackPanel>
        <Label Content="Player" Height="28" HorizontalAlignment="Left" Margin="12,121,0,0" Name="labelPlayer" VerticalAlignment="Top" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="60,121,0,0" Name="textBoxPlayer" VerticalAlignment="Top" Width="76" TextChanged="textBoxPlayer_TextChanged" IsReadOnly="True" Grid.ColumnSpan="2" />
        <Label Content="Sum" Height="28" HorizontalAlignment="Left" Margin="62,121,0,0" Name="labelSumText" VerticalAlignment="Top" Grid.Column="1" />
        <Label Content="Sum" Height="28" HorizontalAlignment="Left" Margin="97,120,0,0" Name="labelSumValue" VerticalAlignment="Top" Grid.Column="1" />
        <Button Content="Stand" Height="23" HorizontalAlignment="Left" Margin="207,126,0,0" Name="buttonDraw" VerticalAlignment="Top" Width="63" Click="buttonDraw_Click" Grid.Column="1" />
        <Button Content="Draw" Height="23" HorizontalAlignment="Right" Margin="0,125,104,0" Name="buttonStand" VerticalAlignment="Top" Width="55" Click="buttonStand_Click" Grid.Column="1" />
    </Grid>
</UserControl>

CardGUIUserControlWpf : 

<UserControl x:Class="CardGameControls.CardGUIUserControlWpf"
             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" 
             d:DesignHeight="91" d:DesignWidth="84" Loaded="UserControl_Loaded" Name="cardUserControl">
    <Grid Width="79" Height="88">
        <Grid.RowDefinitions>
            <RowDefinition Height="82*" />
            <RowDefinition Height="6*" />
        </Grid.RowDefinitions>
        <Image Height="41" HorizontalAlignment="Left" Margin="24,23,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="32" ImageFailed="image1_ImageFailed" OpacityMask="#FF001919" Source="Images/Diamond.ico" />
        <Label Content="Label" Height="27" HorizontalAlignment="Left" Name="labelValue" VerticalAlignment="Top" Width="39" />
        <Label Content="Label" Height="28" HorizontalAlignment="Left" Margin="43,61,0,0" Name="labelValue2" VerticalAlignment="Top" Background="White" Width="38" Grid.RowSpan="2" />
    </Grid>
</UserControl>


Try removing assembly part in xmlns. xmlns:my="clr-namespace:CardGameControls

(Old: xmlns:my="clr-namespace:CardGameControls;assembly=CardGameControls)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜