I cant' figure out how to reference the current instance object defined by the XAML file in the XAML file.
I have a converter that I want to send in the current instance as the parameter object.
{Binding Path=<bindingObject>, Converter={x:Static namespace:Converter.Instance}, ConverterParameter=this}
In this code this is converted to a string instead of a reference to the current instance object.
Thanks
John
According to the Data Binding Overview, you can use the "/" to indicate the current item. You can then navigate up and down the tree as needs be using the following type syntaxes:
<Button Content="{Binding }" />
<Button Content="{Binding Path=/}" />
<Button Content="{Binding Path=/Description}" />
Technically, the ConverterParameter is not a DependencyProperty, so you can't bind to it. It would be nice to do a ConverterParameter={Binding ElementName=this}, but you can't bind to a non-dependency property.
But, someone figure it out how to do it here. This is however a bit complicated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With