Xamarin形成当前的.Properties

Xamarin形成当前的.Properties,xamarin,xamarin.forms,Xamarin,Xamarin.forms,当我将字符串存储在Current.Properties中时,一切正常,但当我卸载windows phone应用并重新安装它时,设备上似乎仍然有Current.Properties密钥 我的问题是,在windows phone上卸载应用程序时,如何清除当前的.Properties键?首先,我们必须找出表单存储数据的位置。 快速查看显示,它存储在文件PropertyStore.forms的漫游文件夹中 我不知道任何卸载检测。这就是为什么wy的方法是在第一次发布应用程序时删除属性示例代码适用于Wind

当我将字符串存储在Current.Properties中时,一切正常,但当我卸载windows phone应用并重新安装它时,设备上似乎仍然有Current.Properties密钥


我的问题是,在windows phone上卸载应用程序时,如何清除当前的.Properties键?首先,我们必须找出表单存储数据的位置。 快速查看显示,它存储在文件
PropertyStore.forms
的漫游文件夹中

我不知道任何卸载检测。这就是为什么wy的方法是在第一次发布应用程序时删除属性示例代码适用于Windows Phone 8.1,在其他Windows Phone平台上,您必须这样做

App.xaml.cs

公共密封部分类应用程序:应用程序
{
常量字符串设置sapplaunched=“appLaunched”;
公共静态bool IsFirstLaunch()
{
var settings=Windows.Storage.ApplicationData.Current.LocalSettings;
return!settings.Values.ContainsKey(settingsAppLaunched);
}
仅启动受保护的覆盖无效(启动ActivatedEventArgs e)
{           
// ...
if(rootFrame==null)
{
// ...
Xamarin.Forms.Forms.Init(e);
if(IsFirstLaunch())
{
var settings=Windows.Storage.ApplicationData.Current.LocalSettings;
settings.Values[settingsAppLaunched]=true;
Xamarin.Forms.Application.Current.Properties.Clear();
}
}           
// ..
}
}

首先,我们必须找出表单存储数据的位置。 快速查看显示,它存储在文件
PropertyStore.forms
的漫游文件夹中

我不知道任何卸载检测。这就是为什么wy的方法是在第一次发布应用程序时删除属性示例代码适用于Windows Phone 8.1,在其他Windows Phone平台上,您必须这样做

App.xaml.cs

公共密封部分类应用程序:应用程序
{
常量字符串设置sapplaunched=“appLaunched”;
公共静态bool IsFirstLaunch()
{
var settings=Windows.Storage.ApplicationData.Current.LocalSettings;
return!settings.Values.ContainsKey(settingsAppLaunched);
}
仅启动受保护的覆盖无效(启动ActivatedEventArgs e)
{           
// ...
if(rootFrame==null)
{
// ...
Xamarin.Forms.Forms.Init(e);
if(IsFirstLaunch())
{
var settings=Windows.Storage.ApplicationData.Current.LocalSettings;
settings.Values[settingsAppLaunched]=true;
Xamarin.Forms.Application.Current.Properties.Clear();
}
}           
// ..
}
}