C# 我创建了一个Xamarin UWP应用程序,但出于某种原因它';是空白的。如何使我的Xamarin UI显示在UWP应用程序中?

C# 我创建了一个Xamarin UWP应用程序,但出于某种原因它';是空白的。如何使我的Xamarin UI显示在UWP应用程序中?,c#,xaml,xamarin,xamarin.forms,uwp,C#,Xaml,Xamarin,Xamarin.forms,Uwp,对于Xamarin Android应用程序,用户界面不需要定义两次,一次在Xamarin项目中,一次在Android项目中;Android项目似乎能够看到Xamarin项目中对UI所做的更改,并相应地进行调整。但是,当我使用MainPage.xaml创建UWP应用程序时: <forms:WindowsPage x:Class="ApiPrototypeClientMobile.Uwp.MainPage" xmlns="http://schemas.microsoft.com

对于Xamarin Android应用程序,用户界面不需要定义两次,一次在Xamarin项目中,一次在Android项目中;Android项目似乎能够看到Xamarin项目中对UI所做的更改,并相应地进行调整。但是,当我使用MainPage.xaml创建UWP应用程序时:

<forms:WindowsPage
    x:Class="ApiPrototypeClientMobile.Uwp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ApiPrototypeClientMobile.Uwp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:forms="using:Xamarin.Forms.Platform.UWP"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

</forms:WindowsPage>


它是空白的,好像我需要从头开始重新定义UI,或者可能我设置了错误的东西,因此无法正确加载。我真的需要为UWP重新定义整个应用程序的UI吗?还是我只是设置了错误?

不需要做任何特定的事情来支持UWP。有些插件可能不支持UWP,这可能就是原因。或者布局是不可能的,因为与其他平台不同,某些UWP控件在默认情况下具有填充。它可能是各种各样的东西,所以你需要逐个检查是什么阻止了你的UI出现。

Hmm,我对Xamarin或UWP没有太多经验-可能需要检查哪些部分?请检查UWP原生项目是否在MainPage类代码中调用了
LoadApplication()