0
votes

I am somewhat new in windows phone 8 and getting lost in this {Binding} stuff. i want to know how does this button commandparameter binding? and what does this commandparameter binding to?

   <data:MoviesByCategory x:Key="movies"/>
    <data:MoreCommand x:Key="moreCommand" />
 <phone:LongListSelector x:Name="codeMovies" IsGroupingEnabled="true"
                                      ItemsSource="{StaticResource movies}"
                                      ListHeaderTemplate="{StaticResource movieListHeader}"
                                      GroupHeaderTemplate="{StaticResource movieGroupHeader}"
                                      ItemTemplate="{StaticResource movieItemTemplate}"
                                      JumpListStyle="{StaticResource MoviesJumpListStyle}"
                                      toolkit:TiltEffect.IsTiltEnabled="True">

                <!-- The group footer template, for groups in the main list -->
                <phone:LongListSelector.GroupFooterTemplate>
                    <DataTemplate>
                        <Button DataContext="{Binding}" Content="{Binding GetMore}"
                                Command="{StaticResource moreCommand}" CommandParameter="{Binding}"/>
                    </DataTemplate>
                </phone:LongListSelector.GroupFooterTemplate>
1

1 Answers

1
votes

Using {Binding} will bind to the current DataContext so setting DataContext="{Binding}" can just be removed as it do absolutely nothing.
Since CommandParameter="{Binding}" is inside the GroupFooterTemplate, the dataContext will be your movie group and thus it will be what CommandParameter is binded to.