简体   繁体   中英

Binding Enum to ComboBox in WPF

I need to bind an Enum to WPF ComboBox , I followed EXACTLY the steps in the great post here (The Better Way) but I always gets this error:

Failed to create a 'Type' from the text 'local:AppLanguage'

Sample project that contain the error here

Thanks in advances

The enum type is a) nested and b) has a lowercase 'l', so is actually called MainWindow.Applanguage .

In order to write this in XAML you have to use a plus character for the nested delimiter, like this:

{x:Type local:MainWindow+Applanguage}

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