❔ How do i handle user settings in wpf .net core
How do i handle user settings in WPF .NET 6?
14 Replies
Define "user settings"? M.E.C doesnt support two-way config updates very well, so it might not be ideal for that usecase.
basically settings that the end-users can change
by editing the config file manually, or through some WPF interface in your app?
through the wpf interface
with bindings
Right. Thats unfortunately not the best usecase for M.E.C afaik
oh
it has good support for reloading the file as it changes, but it doesnt have two-way binding support
so what's a good library for handling user settings in general?
Whats wrong with
System.Configuration
?
it supports two-way bindingdoes it support other types like enums?
I have no idea. Lets try.
can confirm, works fine with enums
strings, ints are all fine too
it gets xml serialized by default
I made a shitty window that has a
TestSettings
instance (added and fetched from the Configuration
object made by ConfigurationManager.OpenExeConfiguration
) set as its datacontext and bound it there. Works fine setting values, changing values, restarting the program etc.Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Thats fair. Set up a simple POCO object for your config, add some Load/Save methods and you're done
thats probably a lot easier 😄
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.