DEV Community

Alexey
Alexey

Posted on

Answer: Custom Type In Application Settings

Here is a more common solution, which can be used for collections as well press View code in Settings to open Settings.cs

Add your property this way:

    [global::System.Configuration.UserScopedSettingAttribute()]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Configuration.DefaultSettingValueAttribute("")]
    public YourType PropertyName
    {
        get => (YourType)this["PropertyName"];
        set => this["PropertyName"] = value;
    }

YourType here can be collection like List<object>โ€ฆ

Top comments (0)