开发者

Settings aren't saving in WPF?

开发者 https://www.devze.com 2022-12-25 11:30 出处:网络
I\'m using the registry Settings.settings thingy开发者_如何学Cmabob I\'m doing the following in my XAML:

I'm using the registry Settings.settings thingy开发者_如何学Cmabob

I'm doing the following in my 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:

Properties.Settings.Default.Save();

But it wont save settings?


Try to write Text attribute like this:

Text="{Binding Source={x:Static prop:Settings.Default}, Path=Username, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
0

精彩评论

暂无评论...
验证码 换一张
取 消