Тег 'CardGUIUserControlWpf' не существует в пространстве имен XML 'clr-namespace: CardGameControls; assembly = CardGameControls'. Линия 14 Поз 14 - PullRequest
0 голосов
/ 12 сентября 2011

Тег 'CardGUIUserControlWpf' не существует в пространстве имен XML 'clr-namespace: CardGameControls; assembly = CardGameControls'. Линия 14 поз 14

Ошибка возникает в clas PlayerGUI.xaml.

PlayerGUI - это пользовательский контроль. Он содержит другой UserControl с именем CardGUIUserControlWpf.

прилагаю код:

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

1 Ответ

1 голос
/ 12 сентября 2011

Попробуйте удалить сборочную деталь в xmlns.xmlns:my="clr-namespace:CardGameControls

(Старый: xmlns:my="clr-namespace:CardGameControls;assembly=CardGameControls)

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...