c# - ViewModel 中的 Properties.Settings.Default.Save() 是否可行?
问题描述
奇怪的是,但我不能让它在 ViewModel 中可用。
public class SmallWindow_ViewModel
{
public string My_property
{
get { return _my_property; }
set { Set(ref _my_property, value); }
}
private string _my_property;
public void SmallWindow_unloaded()
{
Properties.Settings.Default.My_property_setting = My_property;
Properties.Settings.Default.Save();
}
}
如果将它放在代码后面,它就可以工作。
解决方案
推荐阅读
- r - 如何在数据框中选择两个所需的列来构建 svm 模型?
- android - 在 Volley 中传递 Edittext 值以获取请求 URL
- c# - 显式流上传文件到谷歌驱动器
- php - php到mysql数据检索
- ios - 函数在签入 if 语句 Swift 后跳转 else 语句
- asp.net - 无法检索“DataSet1”数据集的数据
- excel - 将多个单元格复制/粘贴到 excel 列中时识别重复项
- android - 上下文操作模式删除侧边栏 onClick() :webview
- maven - 将“非 D”参数传递给 jenkins maven 构建步骤
- c# - EntityException:底层提供程序在 Open + 内部异常上失败