Bengi Besceli
Bengi Besceli

Reputation: 3748

Property Content is null or is not IEnumerable

I have a test page in Xamarin.Forms and it gets me this error, how can I fix this ?

Property Content is null or is not IEnumerable

Xaml :

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Project1.Page1">
<ContentPage.Content>
    <Label Text="Page"></Label>
    <Editor Text="I am an Editor" />
  </ContentPage.Content>
</ContentPage>

Upvotes: 9

Views: 6236

Answers (2)

Post Impatica
Post Impatica

Reputation: 16423

If anyone else lands here from google and the above wasn't the fix. For me it was because I had a view with a Grid.Row="0" property set even though I accidentally placed it outside the bounds of the actual grid.

Upvotes: 0

Radin Gospodinov
Radin Gospodinov

Reputation: 2323

The Content property is of type View. You cannot have two views into it. Replace it with

<StackLayout >
    <Label Text="Page"></Label>
    <Editor Text="I am an Editor" />
<StackLayout>

Upvotes: 22

Related Questions