2010-04-05 52 views
1

我使用註冊表Settings.settings thingymabob設置沒有保存在WPF中?

我做我的XAML如下:

<TextBox x:Name="textBoxUsername" 
       Text="{Binding Source={x:Static prop:Settings.Default}, 
       Path=Username, Mode=TwoWay}"></TextBox> 

這是加載設置罰款。現在在我的窗口的Closing事件我有以下幾點:

Properties.Settings.Default.Save(); 

,但它不會保存設置?

回答

3

嘗試寫文本屬性是這樣的:

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

這似乎是我們該做的 – JOSH 2010-04-05 05:02:21