簡體   English   中英

設置不保存在WPF中嗎?

[英]Settings aren't saving in WPF?

我正在使用注冊表Settings.settings somethingymabob

我在XAML中執行以下操作:

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

這樣可以很好地加載設置。 現在,在“窗口的Closing事件中,我具有以下內容:

Properties.Settings.Default.Save();

但這不會保存設置嗎?

嘗試這樣寫Text屬性:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM