Friday 15 June 2012

c# - WPF : Can I bind an enum to a combo-box? -


I am trying to display a combo box which is a set of predefined values ​​- in this case an enum . For example:

  public enum protocol {UDP = 0, TCP, RS232}  

Although I think it has failed to fulfill it. Is this possible at all? I have tried to use the database but Blend has received all the classes from the namespace only, no enum (the object is not clearly)

Force your combo box :

  var name = Enum.GetNames (for typeof (protocol)  Name ;  

No comments:

Post a Comment