Reputation: 16143
The acceptecd answer here explains how a double click event can be realized for a TabItem
.
I understand the approach except of one thing: <Label Content={Binding}>
What exactly does {Binding}
mean here for the labels content?
Upvotes: 0
Views: 84
Reputation: 33364
From Binding.Path
... period (.) path can be used to bind to the current source. For example, Text="{Binding}" is equivalent to Text="{Binding Path=.}"
which means it will bind whole object that is currently available in DataContext
which then will be converted for display using default or custom template
EDIT
In this case TabItem
hosts ContentPresenter
with ContentSource
set to Header
which changes DataContext
to whatever is currently available in Header
therefore DataContext
for Label
will be set to string
as defined in Header
Upvotes: 3