here , i am confuse on {binding} and {binding Account}.when to use only simple {binding} and binding with proprty name in below code binding occur as :Content=”{Binding}”
<Border Grid.Row="1" Grid.Column="0"
Style="{StaticResource MainBorderStyle}"
Background="{StaticResource ResourceListGradientBrush}"
BorderThickness="0,0,1,1"
Padding="0">
<StackPanel>
<HeaderedContentControl
Content="{Binding}"
ContentTemplate="{StaticResource CommandsTemplate}"/>
</StackPanel>
</Border>
where is below code binding occur
as
Text="{Binding Path=Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"/>
so i want to know use of them and difference of them.thank in advance.
{Binding}will simply bind to the actual object set in theDataContext.{Binding Account}will bind to the PropertyAccounton that object.In your case if you had a
ViewModelset against the root levelDataContextthenAccountwould be a property calledAccounton theViewModelWhere you have
All this is doing is setting the
Contentof theHeaderedContentControlto theViewModelprovided you have something like this in the code behind of theWindoworUserControl