tags:

views:

845

answers:

3

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

A: 

Have you tried using the RelativeSource markup extension? You can use Self there.

Omer van Kloeten
+1  A: 

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}" />
Dillie-O
+2  A: 

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.

decasteljau