标签'CardGUIUserControlWpf'clr-namespace:CardGameContr

本文关键字:CardGameContr CardGUIUserControlWpf 标签 clr-namespace | 更新日期: 2023-09-27 18:08:12

标签'CardGUIUserControlWpf'在XML命名空间'clr-namespace: cardgamecontrol;assembly= cardgamecontrol '中不存在。第14行Pos 14

在PlayerGUI类中出现错误。xaml。

PlayerGUI是一个UserControl。它包含另一个名为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>

标签'CardGUIUserControlWpf'clr-namespace:CardGameContr

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

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