Xamarin:Application.Current.Properties-无定义

Xamarin:Application.Current.Properties-无定义,xamarin,xamarin.android,Xamarin,Xamarin.android,在尝试运行我的第一个Xamarin应用程序时,我想保存数据。这似乎是通过以下方式完成的: Application.Current.Properties["id"] = id; 我的问题是Visual Studio无法“识别”当前的应用程序,而Intellisense也没有提供给我 我进口的 using System; using Android.App; using Android.Content; using Android.Widget; using Android.OS; 受保护重写v

在尝试运行我的第一个Xamarin应用程序时,我想保存数据。这似乎是通过以下方式完成的:

Application.Current.Properties["id"] = id;
我的问题是Visual Studio无法“识别”当前的应用程序,而Intellisense也没有提供给我

我进口的

using System;
using Android.App;
using Android.Content;
using Android.Widget;
using Android.OS;
受保护重写void OnCreate(Bundle)中的整个代码:


我缺少什么?

Application.Current.Properties适用于Xamarin.Forms,而不是Xamarin.Android。在Xamarin Android中,您可以使用。

Application.Current.Properties应用于Xamarin.Forms,而不是Xamarin.Android,从而获得类似的结果。在XamarinAndroid中,您可以通过使用

btnSaveLogin.Click += (object sender, EventArgs e) =>
            {
                Application.Current.Properties["id"] = id;
            };