简体   繁体   English

升级到Xamarin Forms 2.0后,为什么会出现此错误?

[英]Why am I getting this error after upgrading to Xamarin Forms 2.0?

For context, I am creating an activity indicator in Xamarin Forms that brings up a new transparent page so it blocks user interaction. 对于上下文,我正在Xamarin Forms中创建一个活动指示器,该指示器会弹出一个新的透明页面,从而阻止用户交互。

Anyway, 无论如何,

Everything is fine with Xamarin Forms 1.3, but when I upgrade to XF 2.0, I'm getting this issue. Xamarin Forms 1.3一切都很好,但是当我升级到XF 2.0时,我遇到了这个问题。

在此处输入图片说明

Here is my code behind for the Xaml 这是Xaml的代码

在此处输入图片说明

ModalSpinnerPage ModalSpinnerPage 在此处输入图片说明

From the auto generated class, It looks like Xamarin thinks my ModalSpinnerPage is a member of Xamarin Forms (although its clearly not) 从自动生成的类中,看起来Xamarin认为我的ModalSpinnerPage是Xamarin Forms的成员(尽管显然不是)

在此处输入图片说明

Again, my problem is that after the Xamarin forms upgrade, Xamarin thinks my ModalSpinnerPage is a member of Xamarin Forms. 同样,我的问题是Xamarin表单升级后,Xamarin认为我的ModalSpinnerPage是Xamarin Forms的成员。 Everything is fine before the upgrade though. 升级之前一切都很好。 Any help on this would be awesome. 任何帮助都会很棒。 Thanks 谢谢

You need to add correct namespaces: 您需要添加正确的名称空间:

<sp:ModalSpinnerClass xmlns:sp="clr-namespace:XSpinner.FormsPlugin;assembly=XSpinner.PutHereCorrectAssemblyPath" /* the rest of properties */>

</sp:ModalSpinnerClass>

Here it's working example (using custom pages as a base): link 这是工作示例(使用自定义页面作为基础): 链接

The following code can work: 以下代码可以工作:

<ModelSpinner:ModelSpinnerPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:ModelSpinner="clr-namespace:XSpinner.FormsPlugin"
         x:Class="XSpinner.FormsPlugin.ModelPageSpinner">
</ModelSpinner>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我会收到未经授权的Yahoo OAuth 2.0错误(401)? - Why i am getting Yahoo OAuth 2.0 error (401) Unauthorized? 在Xamarin.Forms中订阅事件时,为什么只能在iOS上收到NullReferenceException? - Why am I getting a NullReferenceException when subscribing to event in Xamarin.Forms, but only on iOS? 为什么我无法从Xamarin形式的流中获取图像? - Why am I unable to obtain an image from the stream in xamarin forms? 为什么更新VS项目后出现此错误 - Why am I getting this error after updating the VS Project 为什么我在使用反射后在 .NET 7 中出现转换错误? - Why am I getting a casting error in .NET 7 after using reflection? 为什么我没有从我的 BLE 设备发送到我的 xamarin 表单应用程序的字节 [] 中获得正确的值? - Why am I not getting the correct value from my byte [] that is being sent by my BLE-device to my xamarin forms app? 将Xamarin.Forms更新为2.3.0.49后出现错误 - After updating Xamarin.Forms to 2.3.0.49 getting error 为什么我在运行 Xamarin 应用程序时收到 JINativeWrapper.g.cs 文件未找到错误? - Why am I getting JINativeWrapper.g.cs file not found error when running my Xamarin app? 为什么我在 C# Windows 窗体应用程序中收到数据类型不匹配错误 - Why am I getting a Datatype Mismatch error in C# Windows Forms Application 将VS2008 / .NET FX 2.0项目升级到VS2010后出现奇怪的错误 - Getting a weird error after upgrading a VS2008/.NET FX 2.0 project to VS2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM