For me the x:Name solution didn't work. What fixed the error in my case was removing the <ContentPage.Content> and </ContentPage.Content> tags from the xaml.
x:Name
<ContentPage.Content>
</ContentPage.Content>