I need to skip something simple here ... I am writing a Windows Phone 7 application, and I configured my summary header as follows:
<controls:Pivot Name="InfoPivot"> <controls:Pivot.TitleTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Margin="0,0,0,0" VerticalAlignment="Top"> <Rectangle Fill="{Binding CategoryFill}" Height="50" Width="50" Margin="355,25,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Name="CategoryRect" /> <StackPanel Margin="-425,-14,0,0" Width="432"> <TextBlock x:Name="StationTitle" Text="{Binding StationTitle}" Margin="10,0,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> <TextBlock Name="LocationTitle" Text="{Binding LocationTitle}" TextWrapping="Wrap" Margin="12,0,0,20" Style="{StaticResource PhoneTextNormalStyle}"/> </StackPanel> </StackPanel> </DataTemplate> </controls:Pivot.TitleTemplate>
When I go to this page, I pass Station and Location as parameters, and in OnNavigatedTo () for this page I am trying to set StationTitle and LocationTitle. Unfortunately, I get:
Error 2 The name 'StationTitle' does not exist in the current context
How do we do / access members in the Pivot TitleTemplate? Any help would be appreciated! Thanks.
source share