Amin Memar

Amin Memar

  • 1.6k
  • 180
  • 29.2k

create Properties.Setting at runtime

Apr 2 2020 5:41 PM
hi
i want to create dynamically new Property.Settings at runtime i tried this code but not worked t
also no changes in setting (i am using wpf).can anyone help pls?
 
 
  1. var property = new System.Configuration.SettingsProperty("propertyName");  
  2.             property.PropertyType = typeof(bool);  
  3.             property.DefaultValue = true;  
  4.             Properties.Settings.Default.Properties.Add(property);  
  5.             Properties.Settings.Default.Save();   

Answers (3)