Xamarin.forms 名称';XForms';在当前上下文中不存在

Xamarin.forms 名称';XForms';在当前上下文中不存在,xamarin.forms,uwp,Xamarin.forms,Uwp,在UWP App.xaml.cs文件中获取标题错误 我正在从我的UWP应用程序向我的主项目发送消息 代码: 收到PushNotification时的私有void(PushNotificationChannel发送方,PushNotificationReceivedEventArgs参数) { var msg=args.ToastNotification.Content.InnerText; XForms.MessagingCenter.Send(this,SmartWCM.App.Notific

UWP App.xaml.cs
文件中获取标题错误

我正在从我的UWP应用程序向我的主项目发送消息

代码:

收到PushNotification时的私有void(PushNotificationChannel发送方,PushNotificationReceivedEventArgs参数) { var msg=args.ToastNotification.Content.InnerText; XForms.MessagingCenter.Send(this,SmartWCM.App.NotificationReceivedKey,msg); } 截图:


MessagingCenter
应位于Xamarin.Forms命名空间下,而不是XForms。我没有在XForms命名空间下看到任何Xamarin.Forms控件/类。

我在下面的youtube视频中看到了
XForms
的用法,感谢您的解决方案,它正在工作。
 private void OnPushNotificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
        {
            var msg = args.ToastNotification.Content.InnerText;
            XForms.MessagingCenter.Send<object, string>(this, SmartWCM.App.NotificationReceivedKey, msg);
        }