I've been successfully using Converters to convert boolean values in WPF to an appropriate property e.g. Hidden/Collapse开发者_开发问答d/Visible for hiding and showing a control.
I'd like to achieve the same thing using the existence of an xpath node- the sort of path you'd test for in XSLT with something like:
<xsl:if test="/SomeNode/Exists"></xsl:if>
If the node exists, I want the converter to output "Visible" and if not "Hidden" or "Collapsed".
Anyone have any ideas?
Create a converter, which will take the XPath query as ConverterParameter.
Some more info.
I don't think there is much more we can do aside from writing the code for you :)
精彩评论