我使用 Xamarin 社区工具包 mauicompat 为 .net maui 实现弹出窗口,但是当我调用打开弹出窗口时,出现如下图所示的错误
我的代码在这里:
public partial class HomePage : ContentPage
{
public HomePage()
{
InitializeComponent();
}
private void BtPop_Clicked(object sender, System.EventArgs e)
{
Navigation.ShowPopup(new PopupServicess()
{
IsLightDismissEnabled = true,
});
}
private void CollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
}
这是我的 xaml 文件:
<xct:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
Size="300,300"
x:Class="NailsApp.Views.PopupServicess">
<StackLayout>
<Label Text="Hello from Popup!"/>
</StackLayout>
</xct:Popup>
public partial class PopupServicess : Popup
{
public PopupServicess()
{
}
}