Sreejith Sree
Sreejith Sree

Reputation: 3671

The name 'XForms' does not exist in the current context

Getting the title error in UWP App.xaml.cs file.

I am sending a message from my UWP app to my main project.

Code:

 private void OnPushNotificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
        {
            var msg = args.ToastNotification.Content.InnerText;
            XForms.MessagingCenter.Send<object, string>(this, SmartWCM.App.NotificationReceivedKey, msg);
        }

ScreenShot:

enter image description here

Upvotes: 0

Views: 51

Answers (1)

TaylorD
TaylorD

Reputation: 687

MessagingCenter should be under the Xamarin.Forms namespace and not XForms. I haven't seen any Xamarin.Forms controls/classes under the XForms namespace.

Upvotes: 1

Related Questions