wpf - How to use enum value to set header for a tab item of a tab-control? -
i want header of selected tab-item of tab-control , activate tab-item of tab-control appropriately, eg. select tab "a"/"b" of tab-control tc1 activate tab "a"/"b" on tab-control tc2.
i want "a", "b", ... enum value no string comparation used. so, how can use enum value set tab-item's header?
[edit] , yes, prefer use enum value directly in xaml codes
i'd use wpf valueconverter.
in xaml,
<tab header={binding propthatreturnstheenum, converter=enumtodisplaytextconverter}>....</tab>
on other hand, if you're implying want set text of tab named member of enumeration hardcoded in xaml, use static markupextension
<tab header={x:static local:myenum.member1}>... </tab>
Comments
Post a Comment