Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 获取名为';XamlParseException';_C#_Uwp - Fatal编程技术网

C# 获取名为';XamlParseException';

C# 获取名为';XamlParseException';,c#,uwp,C#,Uwp,我在尝试开发应用程序时遇到此错误,编译器说找不到错误代码。所以我没有更多的信息。我知道错误是在尝试初始化组件时产生的。 以下是我的页面代码: <RelativePanel Padding="40"> <Image x:Name="logo" Source="ms-appx:///Assets/UPSA.jpg" Width="150" Height="200"/> <Border RelativePanel.RightOf="logo" H

我在尝试开发应用程序时遇到此错误,编译器说找不到错误代码。所以我没有更多的信息。我知道错误是在尝试初始化组件时产生的。 以下是我的页面代码:

    <RelativePanel Padding="40">
    <Image x:Name="logo" Source="ms-appx:///Assets/UPSA.jpg" Width="150" Height="200"/>

    <Border RelativePanel.RightOf="logo" Height="200" RelativePanel.AlignRightWithPanel="True" Background="Orange" UseLayoutRounding="True" CornerRadius="40,40,40,40" Margin="30,0,0,0" />
    <TextBlock Text="Universidad Pontifica de Salamanca" FontSize="72" RelativePanel.RightOf="logo"  RelativePanel.AlignRightWithPanel="True" HorizontalAlignment="Center" FontFamily="Cooper Black"  RelativePanel.AlignVerticalCenterWith="logo"/>
    <Grid Margin="30" x:Name="mainGridL" RelativePanel.Below="logo" Height="500" RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignLeftWithPanel="True">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.3*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <RelativePanel Grid.Column="0" >
            <TextBlock x:Name="textPersonal" Text="Datos Personales" FontSize="60" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="Orange"/>
            <Line x:Name="lineBText" Stroke="Black" RelativePanel.Below="textPersonal" Width="770" StrokeThickness="20" X1="0" X2="770"/>
            <Line x:Name="lineMid" Stroke="Black" RelativePanel.Below="textPersonal" Width="770" StrokeThickness="20" X1="770" X2="770" Y1="0" Y2="420" />
            <Grid RelativePanel.Below="lineBText" Margin="0,20,0,0" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignLeftWithPanel="True">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="0.5*"/>
                    <RowDefinition Height="0.5*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" x:Name="textDni" Text="Dni" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
                <TextBlock Grid.Row="0" Grid.Column="1" x:Name="textEmail" Text="Email" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0" />
                <TextBox  Grid.Row="1" Grid.Column=" 0" x:Name="nifBox" PlaceholderText="DNI..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="29,0,30,0"  />
                <TextBox x:Name="emailBox" Grid.Row="1" Grid.Column="1" PlaceholderText="Email..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0" />
                <TextBlock Grid.Row="2" Grid.Column="0"  Text="Nombre" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
                <TextBlock  Grid.Row="2" Grid.Column="1"  Text="Apellidos" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
                <TextBox x:Name="nameBox" Grid.Row="3" Grid.Column=" 0" PlaceholderText="Nombre..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0"  />
                <TextBox x:Name="surnameBox" Grid.Row="3" Grid.Column="1" PlaceholderText="Apellido..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0" />
                <TextBlock Grid.Row="4" Grid.Column="0"  Text="Genero" FontSize="35" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                <RadioButton Grid.Row="5" Grid.Column="0" x:Name="genderMale" Content="Hombre" FontSize="20" HorizontalAlignment="Center" Grid.ColumnSpan="2"/>
                <RadioButton Grid.Row="6" Grid.Column="0" x:Name="genderFemale" Content="Mujer" FontSize="20" HorizontalAlignment="Center" Grid.ColumnSpan="2"/>

            </Grid>


        </RelativePanel>
        <RelativePanel Grid.Column="1">
            <TextBlock x:Name="textIns" Text="Datos Inscripcion" FontSize="60" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="Orange"/>
            <Line x:Name="lineBTextIns" Stroke="Black" RelativePanel.Below="textIns" Width="770" StrokeThickness="20" X1="0" X2="770"/>
            <StackPanel RelativePanel.Below="lineBTextIns" Orientation="Vertical" RelativePanel.AlignLeftWithPanel="True" RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignBottomWithPanel="True" VerticalAlignment="Center" HorizontalAlignment="Center">
                <TextBlock Text="Titulacion cursada" FontSize="40" Margin="0,0,0,30"/>
                <ComboBox x:Name="degreeName"  PlaceholderText="Esoge tu titulacion"  HorizontalAlignment="Center">
                    <x:String>ADET</x:String>
                    <x:String>Ing.Informatica</x:String>
                    <x:String>ADET + Ing.Informatica</x:String>
                    <x:String>Ing.Informatica + ADET</x:String>
                </ComboBox>
                <TextBlock Text="Escoge una charla" FontSize="40" Margin="0,0,0,30"/>
                <ComboBox x:Name="activities" PlaceholderText="Escoge una charla"  HorizontalAlignment="Center" ItemsSource="{Binding Name}"/>

            </StackPanel>
        </RelativePanel>



    </Grid>
    <Button RelativePanel.Below="mainGridL" Content="Enviar" FontSize="40" Margin="0,21,0,0" RelativePanel.AlignHorizontalCenterWithPanel="True" />
</RelativePanel>

阿黛特
信息学
熟练掌握信息
Ing.Informatica+ADET
经过长时间的尝试和错误,我找到了问题所在。在最深的网格中,错误是在尝试创建TextBox时生成的,不知道为什么,因为如果您只是删除TextBox,它会正常工作。 这里是错误

            <Grid RelativePanel.Below="lineBText" Margin="0,20,0,0" RelativePanel.AlignBottomWithPanel="True" RelativePanel.AlignRightWithPanel="True" RelativePanel.AlignLeftWithPanel="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="0.5*"/>
                <RowDefinition Height="0.5*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" x:Name="textDni" Text="Dni" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
            <TextBlock Grid.Row="0" Grid.Column="1" x:Name="textEmail" Text="Email" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0" />
            <TextBox  Grid.Row="1" Grid.Column=" 0" x:Name="nifBox" PlaceholderText="DNI..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="29,0,30,0"  />
            <TextBox x:Name="emailBox" Grid.Row="1" Grid.Column="1" PlaceholderText="Email..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0" />
            <TextBlock Grid.Row="2" Grid.Column="0"  Text="Nombre" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
            <TextBlock  Grid.Row="2" Grid.Column="1"  Text="Apellidos" FontSize="35"   VerticalAlignment="Center" Margin="30,0,0,0"/>
            <TextBox x:Name="nameBox" Grid.Row="3" Grid.Column=" 0" PlaceholderText="Nombre..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0"  />
            <TextBox x:Name="surnameBox" Grid.Row="3" Grid.Column="1" PlaceholderText="Apellido..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0" />
            <TextBlock Grid.Row="4" Grid.Column="0"  Text="Genero" FontSize="35" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            <RadioButton Grid.Row="5" Grid.Column="0" x:Name="genderMale" Content="Hombre" FontSize="20" HorizontalAlignment="Center" Grid.ColumnSpan="2"/>
            <RadioButton Grid.Row="6" Grid.Column="0" x:Name="genderFemale" Content="Mujer" FontSize="20" HorizontalAlignment="Center" Grid.ColumnSpan="2"/>

        </Grid>


谢谢你的帮助。

请注意这两行:

<TextBox  Grid.Row="1" Grid.Column=" 0" x:Name="nifBox" PlaceholderText="DNI..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="29,0,30,0"  />
<TextBox x:Name="nameBox" Grid.Row="3" Grid.Column=" 0" PlaceholderText="Nombre..." FontSize="20" Background="Gray"  VerticalAlignment="Center" Margin="30,0,30,0"  />

在Grid.Column中,0值之前有一个额外的空格。您需要通过“0”而不是“0”