我的 Xamarin Forms 界面不显示任何控件或属性

My Xamarin Forms interface does not show any control or properties

我正在为 android 模拟器使用 Genymotion 执行 Xamarin 表单应用程序,问题是它没有显示我的 XAML 页面的任何控件或 属性,因为你可以在这个screenshoot中看到。 我不记得更改过任何相关内容,所以我不知道发生了什么或为什么会发生,知道如何解决这个问题吗?

XAML代码:

<?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 页数:

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();
        }
    }
}

如果您需要更多信息,我会在看到您的请求后立即提供,谢谢大家的宝贵时间,祝您愉快。

从未使用过 Genymotion(一直使用物理设备),但我注意到在您的 .cs 页面中您缺少对 InitializeComponent(); 的调用我愿意打赌这就是问题所在,否则一切似乎都很好我一目了然。

不过,我也注意到您的母版页只有一个空的 ContentPage,我想知道这是否是问题的一部分