我无法弄清楚如何在 XAML 文件中引用 XAML 文件定义的当前实例对象。
我有一个转换器,我想将其作为参数对象发送到当前实例中。
{Binding Path=<bindingObject>, Converter={x:Static namespace:Converter.Instance}, ConverterParameter=this}
在此代码中,它被转换为字符串,而不是对当前实例对象的引用。
Thanks
John
根据数据绑定概述 http://msdn.microsoft.com/en-us/library/ms752347.aspx#current_record_pointers,可以使用“/”来表示当前项。然后,您可以根据需要使用以下类型语法在树中上下导航:
<Button Content="{Binding }" />
<Button Content="{Binding Path=/}" />
<Button Content="{Binding Path=/Description}" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)