Is it possible to bind to a value in Properties.Settings.Default?

后端 未结 2 1529
抹茶落季
抹茶落季 2021-01-25 10:29

Is it possible to bind to a value in Properties.Settings.Default in a way that will keep my UI current with the value stored there?

I have a class:

publi         


        
相关标签:
2条回答
  • 2021-01-25 10:47

    You need your properties to implement INotifyPropertyChanged in order for bindings to recognise when the property value changes.

    0 讨论(0)
  • 2021-01-25 10:49

    Conveniently for you, ApplicationSettingsBase implements INotifyPropertyChanged so you just need to subscribe to PropertyChanged on Properties.Settings.Default and raise your own PropertyChanged in response.

    0 讨论(0)
提交回复
热议问题