简体   繁体   中英

Why there is no generic list in WPF Settings?

I wanted to save a List of objects in a WPF application using the Settings, but there is no such collection type. My app is very simple, so I didn't want to use any database, XML or other options.
I guess that Settings should be used for storing the settings (nothing insightful...), but why collections like Stack or Queue are still available?

Screenshots from project's Settings:

在System.Collections中

在System.Collections.Specialized中

I think the problem is specification of generic type. How will you specify the generic type, if you chose the type of your setting List<T> , where will you specify T ? So there are collections which works with object s and boxing, eg ArrayList .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM