wpf - Reuse element defined further up in App.xaml -
i declare several converters in app.xaml follows repeating myself avoid:
<c:converterchain x:key="isnotnull"> <c:isnullconverter /> <c:invertboolconverter /> </c:converterchain> <c:converterchain x:key="hidewhennull"> <c:isnullconverter /> <c:invertboolconverter /> <c:booltofromvisibilityconverter falseequivalent="hidden" /> </c:converterchain> <c:converterchain x:key="collapsewhennull"> <c:isnullconverter /> <c:invertboolconverter /> <c:booltofromvisibilityconverter falseequivalent="collapsed" /> </c:converterchain>
as can see isnotnull
reused in 2 following converter chains, possible declare somehow? i'm thinking of like:
<c:converterchain x:key="hidewhennull"> <reference name="isnotnull" /> <c:booltofromvisibilityconverter falseequivalent="hidden" /> </c:converterchain>
is there wpf concept out there cover use case?
<c:converterchain x:key="hidewhennull"> <dynamicresource resourcekey="isnotnull"/> <c:booltofromvisibilityconverter falseequivalent="hidden" /> </c:converterchain>
as long converterchain class supports nesting.
Comments
Post a Comment