步骤1:创建新的PCL项目
步骤2:从nuget包管理器添加Xlabs forms dll (版本:2.0.5782)
步骤3:然后我在mainpage.xaml文件中添加了下面的代码
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App2"
xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
x:Class="App2.MainPage">
<StackLayout>
<controls:WrapLayout></controls:WrapLayout>
</StackLayout>
</ContentPage>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App3
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
}步骤4:然后在uwp中运行此项目

第5步:我得到了这个错误
如果任何人有任何想法,请帮助我........
发布于 2017-07-26 14:13:44
我解决了它(我认为这不是一个正确的方法),但我发现了问题。dll在应用程序加载时未初始化。所以我在下面的代码中尝试了一下。
我试图在initializeComponent()之前初始化我的XLab dll。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using XLabs.Forms.Controls;
namespace App3
{
public partial class MainPage : ContentPage
{
public MainPage()
{
WrapLayout wp = new WrapLayout();
InitializeComponent();
}
}
}https://stackoverflow.com/questions/45311680
复制相似问题