Are "{Binding Path=.}" and "{Binding}" really equal Are "{Binding Path=.}" and "{Binding}" really equal wpf wpf

Are "{Binding Path=.}" and "{Binding}" really equal


The point of the exception presumably is that you cannot two-way bind a binding-source itself, so it tries to prevent you from creating a binding which does not behave the way you would want it to. By using {Binding Path=.} you just trick the error handling.

(Also it's not unheard of that documentation is erroneous or inaccurate, though i do like the MSDN documentation a lot in general as it usually does contain the crucial points one is interested in)


The documentation states that {Binding} is equivalent to {Binding Path=.}. However it is not equivalent to {Binding Path} as you have typed. If you include the Path property, you must assign it to something, be it Path=. or Path=OtherProperty.


These are not the same. If you bind this where ConsoleMessages is an ObservableCollection string with just {Binding} you get a "Two-way binding requires Path or XPath." exception where as {Binding Path=.} works. This is with WPF 4.0...

    <ItemsControl x:Name="ConsoleOutput" ItemsSource="{Binding ConsoleMessages, Mode=OneWay}" MaxHeight="400">        <ItemsControl.ItemTemplate>            <DataTemplate>                <TextBox Text="{Binding Path=.}" BorderThickness="0" Margin="0" />            </DataTemplate>        </ItemsControl.ItemTemplate>    </ItemsControl>

My 2p worth...