Search code examples
xamarin.formsbindingdatacontext

Xamarin.Forms Binding with only dot as a path


As I know, in Xamarin.Forms you need a source and a path, in order to perform a binding.

Now, I've encountered this piece of code:

<Grid Padding="10">
   <Label Text="{Binding Title}" d:Text="{Binding .}" FontSize="20"/>
</Grid>
  • The source is initialized in the code by a Binding Context.
  • The path in Text="{Binding Title}" is Title.
  • What is the path in Text="{Binding .} ? (and yep, I know that d: means ignorable). I just don't remember I've seen dot character as a path.

Solution

  • {Binding .} and {Binding} both refer to the entire BindingContext, instead of a specific property of the BindingContext