1

I have been working with Xamarin Forms with XAML and keep seeing places where {Binding .} is used, so for example:

<Label Text="{Binding .}" YAlign="Center" FontSize="Medium" />

I am familiar with Data Binding but what exactly does {Binding .} do?

pnavk
  • 4,552
  • 2
  • 19
  • 43
  • possible duplicate of [Special symbols in WPF binding - what does "{Binding Path=.}" mean?](http://stackoverflow.com/questions/1066262/special-symbols-in-wpf-binding-what-does-binding-path-mean) – O. R. Mapper Jun 30 '15 at 15:16

1 Answers1

2

Period is a longer way of saying {Binding}; i.e. bind to current object* with no discreet pathing. Remember that binding is simply reflection with a pathing information provided. Extraction of the data is the following step.

  • The current object is the one that resides in the control's data context. If there is nothing defined in the control's data context, it assumes/"looks to" its parent's data context. That upwards looking for data continues for each parent til the page's data context is accessed. If one of those contexts in the chain has data, that object will be used by the current control.
ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122