tags:

views:

39

answers:

1

I have this sample code:

<ControlTemplate Content="{Binding .}"/>

What does the point mean here relating to the binding?

+3  A: 

The . (period) of the binding refers to the binding path, and simply tells it to bind to the current source (i.e. inherited DataContext).

From the MSDN page:

Optionally, a period (.) path can be used to bind to the current source. For example, Text=”{Binding}” is equivalent to Text=”{Binding Path=.}”.

Also note that Path= can be omitted if Path is the first parameter, so your code means exactly the same. I tend to prefer just the {Binding} syntax, though it's up to you.

Noldorin
Thank you for information
Polaris
No problem. Are you wating for more info before accepting the answer?
Noldorin