My project is developing in WPF with MVVM. In viewModel consuming WCF services. In View app.config file is present and it contains information about WCF configurations like endpoint info... . We have two services like service1 and service2 both are identical having function but the service address will be different. Service1 is communicating with DataBase1 and the service2 is communicating with Database2, so service to DB is one to one mapping. In view a ComboBox is there which will show two option like DB1 and DB2. Based the comboBox selection i have to update my app.config file [endpoint address] as per WPF-MVVM pattern. Because application should re-init with new service - DB function call. So, If ComboBox selection changed where command will invoke which is (command) is written in ViewModel. So how to update config file?
Else is there anyother way to achieve this?