Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将枚举绑定到上下文菜单,以便显示该枚举的所有变体,并为当前选定的选项打勾?
您可以为此任务创建一个简单的转换器,它将字符串转换为枚举值。 静态方法Enum.Parse(),并Enum.GetNames()会帮助你。
Enum.Parse()
Enum.GetNames()