[英]Settings aren't saving in WPF?
I'm using the registry Settings.settings thingymabob 我正在使用注册表Settings.settings somethingymabob
I'm doing the following in my XAML: 我在XAML中执行以下操作:
<TextBox x:Name="textBoxUsername"
Text="{Binding Source={x:Static prop:Settings.Default},
Path=Username, Mode=TwoWay}"></TextBox>
This is loading the settings fine. 这样可以很好地加载设置。 Now in my Window's Closing
event I have the following: 现在,在“窗口的Closing
事件中,我具有以下内容:
Properties.Settings.Default.Save();
But it wont save settings? 但这不会保存设置吗?
尝试这样写Text属性:
Text="{Binding Source={x:Static prop:Settings.Default}, Path=Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.