Populate a drop down list in dynamic content from AppSettings

How to make dynamic content in EPiServer CMS 7 like PropertyDropDownList populated from AppSettings.

As of EPiServer CMS 7.1 dynamic content is still based on the "old" CMS 6 way of doing things. That means (as far as I know) no real MVC-support. You can still use them in MVC projects but with a few do's and don't. One thing I found especially hard to do was populate a PropertyDropDownList from a value set in AppSettings. In "normal" page type models UIHint is used as a way to make EPi generate the drop down, but when it comes to dynamic properties we simply can't do that since they are running in, let's call it legacy mode. So, we have to create a custom property that do all the AppSettings stuff for us.

There's really no super awesome h4xx0r advanced stuff involved, just two classes that extend PropertyDropDownList and PropertyDropDownListControl. To initiate the custom property all we have to do is create a new instance of PropertyAppSettingsDropDownList and set the property "AppSetting" to the value we want to use.