Search code examples
c#xamarinxamarin.formsgenymotion

My Xamarin Forms interface does not show any control or properties


I am executing a Xamarin forms app using Genymotion for the android emulator, and the problem is that it does not show any control or property of my XAML page, as you can see in this screenshoot. I don't remember changing anything relevant, so I don't know what happened or why happened, any idea of how can I fix this?

XAML code:

<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:Class="XamForms.MainPage">

    <MasterDetailPage.Detail>
        <ContentPage>
            <StackLayout
        BackgroundColor="Red">
                <Button
            BackgroundColor="Aqua"></Button>
            </StackLayout>
        </ContentPage>
    </MasterDetailPage.Detail>
    <MasterDetailPage.Master>
        <ContentPage>

        </ContentPage>
    </MasterDetailPage.Master>
</MasterDetailPage>

XAML.cs page:

namespace XamForms
{
    // Learn more about making custom code visible in the Xamarin.Forms previewer
    // by visiting https://aka.ms/xamarinforms-previewer
    [DesignTimeVisible(false)]
    public partial class MainPage : MasterDetailPage
    {
        public MainPage()
        {
            BindingContext = new MainPageViewModel();
        }
    }
}

If you need more information I will give it as soon as I see your request, thank you all for your time, have a good day.


Solution

  • Never used Genymotion (always used a physical device), but i notice that in your .cs page you are missing a call to InitializeComponent(); I am willing to bet that is the issue as otherwise everything seems fine to me at a glance.

    Although, I also notice that your Master page just has an empty ContentPage, I wonder if that is part of the issue