I am trying to is disable the visibility of the TextBlock. I can reference the TextBlock in the following example:
XAML File
<phone:PivotItem Header="Pivot 1">
<TextBlock Text="hello world" x:Name="dummytext" />
</phone:PivotItem>
CS File
dummytext.Visibility = Visibility.Collapsed;
But I can't reference it when I have this following code:
XAML File
<phone:PivotItem Header="{Binding Dummy.Title}">
<Grid Margin="0,0,-12,0">
<ListBox x:Name="Box1">
<phone:LongListSelector ItemsSource="{Binding Dummy.Items}">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel>
<Grid>
//REFERENCE THIS TEXTBLOCK
<TextBlock Text="hello world" x:Name="dummytext" />
</Grid>
<Grid>
<TextBlock Text="byee world" x:Name="dummytext2" />
<TextBlock Text="bye2 world" x:Name="dummytext3" />
</Grid>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</ListBox>
</Grid>
</phone:PivotItem>
I am new to Windows Phone development and still learning. Can you point me to where I am going wrong?