abdelwaheb ammar

abdelwaheb ammar

  • 1.3k
  • 457
  • 123.9k

explanation about source code of combobox

Jan 19 2018 8:40 AM
I find this source code that allows me Binding ComboBox directly to enum values but I do not understand this instruction
  1. public IList<UserType> UserTypes  
  2. {  
  3.     get  
  4.     {  
  5.         // Will result in a list like {"Tester", "Engineer"}  
  6.         return Enum.GetValues(typeof(UserType)).Cast<UserType>().ToList<UserType>();  
  7.     }  
  8. }  
  9.    
  10. public UserType UserType  
  11. {  
  12.     get;  
  13.     set;  
  14. }  
 knowing that this code I find it in this site :http://www.ridgesolutions.ie/index.php/2014/11/05/wpf-xaml-binding-combobox-directly-to-enum-values/

Answers (3)