Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Binding Syntax Question

I've seen this syntax show up, and have tried to google for it's definition to no avail; what does it mean when a dp is bound this way?

<Grid>
    <ContentControl Content="{Binding}"/>
</Grid>

I was under the assumption that you have to bind to some property on the DataContext, or another element, but this appears to bind to nothing.

like image 610
gn22 Avatar asked Dec 29 '22 22:12

gn22


1 Answers

I believe it means you are binding to the root of whatever the binding context is. So if you use this syntax in a datatemplate that is part of some sort of list control, you would be binding to the root level of whatever the parent control (the list control) was binding to.

like image 108
Phil Sandler Avatar answered Jan 15 '23 06:01

Phil Sandler