0

When I try to run my custom control in my application, I get a strange error.

<UserControl x:Class="IBShowdown.BlackHole"
     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:local="clr-namespace:IBShowdown"
     mc:Ignorable="d" Height="100" Width="100">
    <Grid>
        <Image x:Name="imgBh1" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Source="pack://siteoforigin:,,,/Resources/Black Hole 1.png"/>
        <Image x:Name="imgBh2" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Source="pack://siteoforigin:,,,/Resources/Black Hole 2.png"/>
    </Grid>
</UserControl>

My error message: 'Name cannot begin with the '<' character, hexadecimal value 0x3c. Line 8, position 5' XML is invalid. Do you know how I can fix this?

2
  • 1
    Sorry, I cannot reproduce your error with the XAML you've posted above. Commented Oct 21, 2016 at 20:32
  • Can you share the file that uses the custom control? Commented Oct 21, 2016 at 22:39

1 Answer 1

1

Perhaps because UserControl isn't closed?

Try either changing Width="100"> to Width="100"/> just before <Grid> or end the file with </UserControl>

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, I just added the </UserControl> (which solved 1 error), but I am still getting the same error.
Looks fine and valid XML to me, sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.