标签“CardGUIUserControlWpf” XML 命名空间“clr-namespace:CardGameControls; assembly=CardGameControls”中不存在。第 14 行第 14 号位置

发布于 2024-12-04 00:39:47 字数 3868 浏览 0 评论 0原文

XML 命名空间“clr-namespace:CardGameControls; assembly=CardGameControls”中不存在标记“CardGUIUserControlWpf”。第 14 行 Pos 14

错误发生在类 PlayerGUI.xaml 中。

PlayerGUI 是一个用户控件。它包含另一个名为 CardGUIUserControlWpf 的 UserControl。

我附上代码:

         <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/markup-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>

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/markup-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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言 2024-12-11 00:39:47

尝试删除 xmlns 中的装配部分。 xmlns:my="clr-namespace:CardGameControls

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文