Setting multiple enum flags in XAML

放肆的年华 提交于 2019-11-30 00:59:06

问题


Is there any way to set multiple enum flags (that are traditionally separated by | in codebehind) in XAML? I tried something like:

<ns:SomeControl Flags="FlagA|FlagB" />

but that didn't work.


回答1:


WPF does support this through a type converter. It can be done by using a comma in between enum values:

<ns:SomeControl Flags="FlagA,FlagB" />


来源:https://stackoverflow.com/questions/7718928/setting-multiple-enum-flags-in-xaml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!