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.
我已经成功地使用转换器将 WPF 中的布尔值转换为适当的属性,例如 Hidden/Collapsed/Visible 用于隐藏和显示控件。
我想使用 xpath 节点的存在来实现相同的目标 - 您在 XSLT 中测试的那种路径,例如:
<xsl:if test="/SomeNode/Exists"></xsl:if>
如果节点存在,我希望转换器输出“可见”,如果不是“隐藏”或“折叠”。
有人有想法么?
创建一个转换器,它将 XPath 查询作为ConverterParameter。
更多信息。
除了为您编写代码之外,我认为我们无能为力 :)