I'm learning XAML and universal windows apps at the moment. I've encountered an issue where I get an element not found (exception from HRESULT:0x80070490) and I can't seem to figure out where exactly that error is referring to. If I double click on it, VS opens the MainPage.xaml where <Page
is underlined with the error.
It's nothing special... Just a collection of a few controls to play with.
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.Background>
<ImageBrush Stretch="Fill" ImageSource="Assets/320x480-1.jpg"/>
</Grid.Background>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="77,23,68,24">
<TextBox x:Name="HelloMessage" Text="Hello, World!" Margin="10" IsReadOnly="True"/>
<Button x:Name="ClickMe2" Content="Click Me!" Margin="10" HorizontalAlignment="Center" Click="ClickMe2_Click"/>
<Slider x:Name="slider" Margin="10" HorizontalAlignment="Center" VerticalAlignment="Top" Width="100" BorderThickness="0,50,0,0"/>
</StackPanel>
</Grid>
This is the exact error as copied from VS.
Severity Code Description Project File Line Suppression State
Error Element not found. (Exception from HRESULT: 0x80070490) Control D:\Dev\TestUW\App1\App1\MainPage.xaml 1
I tried removing the grid and the error persisted. I also verified that App1.MainPage existed as well. How can I figure out what exactly it's complaining about?
Too late now, but I ran into the same problem, copying the code from the MS OpenCV sample link (https://developer.microsoft.com/en-us/windows/iot/samples/opencv)
The problem was that you needed a space " " before the end of the first "page" tag. So instead of the code reading:
mc:Ignorable="d"> <-- missing space after "d"
it should read:
mc:Ignorable="d" >
Well the first thing i noticed is that your Page Tag is not closed or You just didn't copied that.Usually element not found could be caused due to calling something too early..You might consider using On_Loaded. If the problem is only that you haven't closed your Page tag make sure to do it after the Grid one ..
User contributions licensed under CC BY-SA 3.0