What does "{Binding Path=.}" mean in WPF binding?

WpfData BindingXaml

Wpf Problem Overview


What does {Binding Path=.} mean in a WPF binding?

I see some people use it, but couldn't find any explanation.

Are there any other special symbols in binding syntax (other than {Binding /})?

Wpf Solutions


Solution 1 - Wpf

I found this WPF Binding CheatSheet a few months back and find it very useful, especially for anyone learning WPF. There are some spelling mistakes within it, but it is still quite good.

Here is a small excerpt (which is supposed to have tabular formatting):

Basic Binding
{Binding} Bind to current DataContext.
{Binding Name} Bind to the “Name” property of the current DataContext.
{Binding Name.Length} Bind to the Length property of the object in the Name property of the current DataContext.
{Binding ElementName=SomeTextBox, Path=Text} Bind to the “Text” property of the element XAML element with name=”SomeTextBox” or x:Name=”SomeTextBox”.

Direct link to CheatSheet

Solution 2 - Wpf

This is shorthand for binding to the current source. For more info see here.

From the documentation specifically:

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSergey AldoukhovView Question on Stackoverflow
Solution 1 - WpfRyan VersawView Answer on Stackoverflow
Solution 2 - WpfmicahtanView Answer on Stackoverflow