How to Get Value of Textbox inside data template in windows phone 8 - xaml

When i click on update button then i want to get value of textbox which is inside the data templete.
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Text="Username:" VerticalAlignment="Top" Height="30" Width="176" FontSize="20"/>
<TextBox Text="{Binding Username}" x:Name="tb41" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,4,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="174" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" Grid.Row="1" TextWrapping="Wrap" Text="Password:" VerticalAlignment="Top" Height="28" Width="176" FontSize="20"/>
<TextBox Text="{Binding Password}" x:Name="tb42" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,0,0,1.333" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Bottom" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,10.667,0,0" Grid.Row="2" TextWrapping="Wrap" Text="Confirm Password:" VerticalAlignment="Top" Height="32" Width="176" FontSize="20"/>
<TextBox Text="{Binding ConfirmPassword}" x:Name="tb43" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,11.5,0,0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,10.167,0,0" Grid.Row="3" TextWrapping="Wrap" Text="Name:" VerticalAlignment="Top" Height="31" Width="176" FontSize="20"/>
<TextBox Text="{Binding Name}" x:Name="tb44" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,10.167,0,0" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="10,10.333,0,0" Grid.Row="4" TextWrapping="Wrap" Text="Age:" VerticalAlignment="Top" Height="29" Width="176" FontSize="20"/>
<TextBox Text="{Binding Age}" x:Name="tb45" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,8.333,0,0" Grid.Row="4" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="0,10.167,0,0" Grid.Row="5" TextWrapping="Wrap" Text="Mobile no:" VerticalAlignment="Top" Height="29" Width="186" FontSize="20"/>
<TextBox Text="{Binding Mobile}" x:Name="tb46" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,8.167,0,0" Grid.Row="5" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="0,10,0,0" Grid.Row="6" TextWrapping="Wrap" Text="Email id" VerticalAlignment="Top" Height="32" Width="186" FontSize="20"/>
<TextBox Text="{Binding Email}" x:Name="tb47" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,8.667,0,0" Grid.Row="6" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="0,10.333,0,0" Grid.Row="7" TextWrapping="Wrap" Text="Organisation:" VerticalAlignment="Top" Height="30" Width="186" FontSize="20"/>
<TextBox Text="{Binding Organisation}" x:Name="tb48" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,8,0,0" Grid.Row="7" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock HorizontalAlignment="Left" Margin="0,10.333,0,0" Grid.Row="7" TextWrapping="Wrap" Text="Id:" VerticalAlignment="Top" Height="30" Width="186" FontSize="20"/>
<TextBox Text="{Binding Id}" x:Name="tb49" Grid.Column="1" HorizontalAlignment="Left" Margin="10.167,8,0,0" Grid.Row="7" TextWrapping="Wrap" VerticalAlignment="Top" Width="174"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="Reset" HorizontalAlignment="Left" Margin="56,54,0,0" Grid.Row="7" Grid.RowSpan="2" VerticalAlignment="Top"/>
<Button Content="Update" Grid.Column="1" HorizontalAlignment="Left" Margin="46.167,54,0,0" Grid.Row="7" Grid.RowSpan="2" VerticalAlignment="Top"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

There are different ways to achieve that, here is one:
<Button Content="Update" Tag={Binding ElementName=tb49} Click="Button_Click" />
and in the code behind:
private void Button_Click(object sender, RoutedEventArgs e)
{
Button btn = (Button)sender;
TextBox textBox = (TextBox)btn.Tag;
string text = textbox.Text
}
You can also use the DataContext of the button to access directly the properties of the object that it is bound to.

Related

XAML Databound TextBlock showing unknown character glyph

Question: Why won't my databound text render as text
When I am using databound TextBlock controls, the output in my Windows App shows as Squares, like it can't figure out what to render the text as. If I put actual text in the Text property, it displays normally.
<RelativePanel x:Name="BasicInfo" RightOf="ProfilePicture">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="FirstName" Text="{Binding FirstName}"
TextWrapping="NoWrap" Margin="10,0,0,0"/>
<TextBlock x:Name="LastName" Text="{Binding LastName}"
TextWrapping="NoWrap" Padding="3,0,0,0"/>
</StackPanel>
<TextBlock x:Name="EmailAddress" HorizontalAlignment="Left" Text="{Binding EmailAddress}"
TextWrapping="NoWrap" Margin="10,2,0,0" />
<TextBlock x:Name="PhoneNumber" HorizontalAlignment="Left" Text="{Binding PhoneNumber}"
TextWrapping="NoWrap" Margin="10,2,0,0" />
</StackPanel>
</RelativePanel>
<RelativePanel x:Name="AddressInfo" Below="BasicInfo" RightOf="ProfilePicture" Margin="0, 20, 0, 0">
<StackPanel Orientation="Vertical">
<TextBlock x:Name="Address1" HorizontalAlignment="Left" Text="{Binding Address1}"
TextWrapping="NoWrap" Margin="10,0,0,0"/>
<TextBlock x:Name="Address2" HorizontalAlignment="Left" Text="{Binding Address2}"
TextWrapping="NoWrap" TextAlignment="Left" Margin="10,0,0,0"/>
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="City" HorizontalAlignment="Left" Text="{Binding City}"
TextWrapping="NoWrap" Margin="10,0,0,0"/>
<TextBlock>,</TextBlock>
<TextBlock x:Name="State" Text="{Binding State}"
TextWrapping="NoWrap" Margin="3,0,0,0"/>
</StackPanel>
<TextBlock x:Name="ZipCode" HorizontalAlignment="Left" Text="{Binding ZipCode}"
TextWrapping="NoWrap" Margin="10,0,0,0"/>
</StackPanel>
</RelativePanel>
Here is what the output looks like:
we can try in xaml.cs page
Dispatcher.BeginInvoke(delegate
{
listboxname.ItemsSource = Resultclassname;
});

XAML error: "The property 'VisualTree' is set more than once"

I'm trying to put two Grids in a DataTemplate.
I'm getting the following error with my code shown below.
Error: "The property 'VisualTree' is set more than once"
<DataTemplate x:Key="PareoItemTemplate">
<Grid x:Name="gridColorEjercicio" Height="100" Width="350" Background="#FFF0F0F0" Margin="-11,0,0,0">
<StackPanel Margin="0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Margin="0,10,15,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding letter}" FontSize="24" FontFamily="Resources/Fonts/Programa Tutorias Bold.ttf#Programa Tutorias" Foreground="Black" VerticalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Text="{Binding option}" FontSize="24" FontFamily="Resources/Fonts/Programa Tutorias Bold.ttf#Programa Tutorias" Width="253" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
<Grid VerticalAlignment="Center" Margin="5,10,5,0" HorizontalAlignment="Center">
<Image Source="{Binding imageURI}" />
</Grid>
</StackPanel>
</Grid>
<Grid x:Name="gridPareoColorEjercicio" Height="100" Width="350" Background="#FFF0F0F0" Margin="-11,0,0,0">
<StackPanel Margin="0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Margin="0,10,15,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding letter}" FontSize="24" FontFamily="Resources/Fonts/Programa Tutorias Bold.ttf#Programa Tutorias" Foreground="Black" VerticalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Text="{Binding option}" FontSize="24" FontFamily="Resources/Fonts/Programa Tutorias Bold.ttf#Programa Tutorias" Width="253" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackPanel>
<Grid VerticalAlignment="Center" Margin="5,10,5,0" HorizontalAlignment="Center">
<Image Source="{Binding imageURI}" />
</Grid>
</StackPanel>
</Grid>
</DataTemplate>
A data template can only have one visual tree but you are defining two grids. If you want the two grids to appear next to each other or one below the other, wrap them in a StackPanel and set the property Orientation accordingly.
<DataTemplate>
<StackPanel Orientation="Vertical">
<Grid>[...]</Grid>
<Grid>[...]</Grid>
</StackPanel>
</DataTemplate>

How to expand Designer View with ScrollViewer in Visual Studio 2013?

I am adding more content than the Designer View sees in Visual Studio 2013 for Windows Phone 8. I added ScrollViewer within the Grid to be scrollable but it doesn't scroll neither does designer view and I cannot see the content but only see highlights of my content and move them about invisibility without seeing exactly where I would like it to be positioned. The last three buttons I put are not seen in designer view because the view is cut off from seeing it.
So, I would like a solution as to how I can work with the designer view that expands content larger than designer view on a single page?
Secondly, the ScrollViewer is not visible when applied to the Grid. Any solutions to make it work?
Thanks!
XAML Code Focus:
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="JP APPS" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="<Data Query>" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<ScrollViewer x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" HorizontalScrollBarVisibility="Visible" Height="1000" Width="Auto">
<Grid>
<TextBlock x:Name="firstNameTBL" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="First Name:" VerticalAlignment="Top"/>
<TextBox x:Name="firstNameTB" HorizontalAlignment="Left" Height="72" Margin="0,42,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="lastNameTBL" HorizontalAlignment="Left" Margin="10,119,0,0" TextWrapping="Wrap" Text="Last Name:" VerticalAlignment="Top"/>
<TextBox x:Name="lastNameTB" HorizontalAlignment="Left" Height="72" Margin="0,151,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="emailAddressTBL" HorizontalAlignment="Left" Margin="10,228,0,0" TextWrapping="Wrap" Text="Email Address:" VerticalAlignment="Top"/>
<TextBox x:Name="emailAddressTB" HorizontalAlignment="Left" Height="72" Margin="0,260,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="dateOfBirthTBL" HorizontalAlignment="Left" Margin="10,337,0,0" TextWrapping="Wrap" Text="Date Of Birth:" VerticalAlignment="Top"/>
<toolkit:DatePicker HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="dateOfBirthPicker" ValueChanged="dateOfBirthPicker_ValueChanged" Margin="0,370,0,0"/>
<TextBlock HorizontalAlignment="Left" Margin="10,447,0,0" TextWrapping="Wrap" Text="Gender:" VerticalAlignment="Top"/>
<RadioButton Content="Male" HorizontalAlignment="Left" Margin="0,479,0,0" VerticalAlignment="Top"/>
<RadioButton Content="Female" HorizontalAlignment="Left" Margin="113,479,0,0" VerticalAlignment="Top"/>
<TextBlock Name="fingerprint" HorizontalAlignment="Left" Margin="10,551,0,0" TextWrapping="Wrap" Text="Fingerprint:" VerticalAlignment="Top"/>
<Button Content="SCAN HERE" HorizontalAlignment="Stretch" Margin="0,583,232,208" VerticalAlignment="Stretch"/>
<Button Content="Submit" HorizontalAlignment="Left" Margin="154,0,0,136" VerticalAlignment="Bottom"/>
<Button Content="Reset All" HorizontalAlignment="Left" Margin="10,0,0,131" VerticalAlignment="Bottom"/>
</Grid>
</ScrollViewer>
</Grid>
Full XAML Code:
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="JP APPS" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="<Data Query>" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<!--Height of the Grid has to be greater than the ScrollViewer's Height to make it scrollable.-->
<!--Removing the ScrollViewer's Height enables you to see the entire page in a transparent-like view-->
<ScrollViewer Height="605" Width="480" HorizontalAlignment="Left" Margin="0,0,0,-390" VerticalAlignment="Top" Grid.Row="1">
<Grid MinHeight="605" Height="1000">
<TextBlock x:Name="firstNameTBL" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="First Name:" VerticalAlignment="Top"/>
<TextBox x:Name="firstNameTB" HorizontalAlignment="Left" Height="72" Margin="0,42,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="lastNameTBL" HorizontalAlignment="Left" Margin="10,119,0,0" TextWrapping="Wrap" Text="Last Name:" VerticalAlignment="Top"/>
<TextBox x:Name="lastNameTB" HorizontalAlignment="Left" Height="72" Margin="0,151,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="emailAddressTBL" HorizontalAlignment="Left" Margin="10,228,0,0" TextWrapping="Wrap" Text="Email Address:" VerticalAlignment="Top"/>
<TextBox x:Name="emailAddressTB" HorizontalAlignment="Left" Height="72" Margin="0,260,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="253"/>
<TextBlock x:Name="dateOfBirthTBL" HorizontalAlignment="Left" Margin="10,337,0,0" TextWrapping="Wrap" Text="Date Of Birth:" VerticalAlignment="Top"/>
<toolkit:DatePicker HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="dateOfBirthPicker" ValueChanged="dateOfBirthPicker_ValueChanged" Margin="0,370,0,0"/>
<TextBlock HorizontalAlignment="Left" Margin="10,447,0,0" TextWrapping="Wrap" Text="Gender:" VerticalAlignment="Top"/>
<RadioButton Content="Male" HorizontalAlignment="Left" Margin="0,479,0,0" VerticalAlignment="Top"/>
<RadioButton Content="Female" HorizontalAlignment="Left" Margin="113,479,0,0" VerticalAlignment="Top"/>
<TextBlock Name="fingerprint" HorizontalAlignment="Left" Margin="10,551,0,0" TextWrapping="Wrap" Text="Fingerprint:" VerticalAlignment="Top"/>
<Button Content="SCAN HERE" HorizontalAlignment="Stretch" Margin="0,420,250,0" VerticalAlignment="Stretch" Height="250"/>
<Button Content="Submit" HorizontalAlignment="Stretch" Margin="0,0,250,94" VerticalAlignment="Bottom"/>
<Button Content="Reset All" HorizontalAlignment="Stretch" Margin="235,0,10,94" VerticalAlignment="Bottom"/>
</Grid>
</ScrollViewer>
</Grid>

Memory leak due to GridView in Windows Store apps

I have the following GridView
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemsGridView"
AutomationProperties.Name="Items"
TabIndex="1"
Grid.RowSpan="2"
Padding="116,136,116,46"
SelectionMode="Single"
IsSwipeEnabled="false"
Visibility="Collapsed">
<GridView.ItemTemplate>
<DataTemplate>
<!--<Border BorderBrush="DarkSeaGreen" BorderThickness="1">-->
<Grid Background="{Binding objBackgroundColor}" Opacity="1" Width="400" Height="80">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBlock Text="{Binding objCustomTestPaper.Name}" TextWrapping="Wrap" FontWeight="SemiBold" VerticalAlignment="Top" Foreground="{Binding objForegroundColor}" Style="{StaticResource TitleTextStyle}" FontSize="20" MaxHeight="25" Margin="10,5,10,0" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="120"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Height="35" VerticalAlignment="Center" HorizontalAlignment="Center" Source="Assets/paper.png"></Image>-->
<StackPanel Grid.Column="0" Margin="5,7,0,0">
<callisto:Rating FontStretch="SemiCondensed" ItemCount="5" Value="{Binding objCustomTestPaper.TestRating}" FontWeight="Light" VerticalAlignment="Bottom" Margin="0,2,5,1" Background="Transparent" HorizontalAlignment="Left" Foreground="{Binding objForegroundColor}" IsHitTestVisible="False" FontSize="12" >
</callisto:Rating>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="Attempted by others:" Margin="4,0,0,0" FontSize="12" FontWeight="Light" Foreground="{Binding objForegroundColor}"></TextBlock>
<TextBlock Text="{Binding objCustomTestPaper.AttemptCount}" FontWeight="SemiBold" Margin="5,0,0,0" FontSize="12" Foreground="{Binding objForegroundColor}"></TextBlock>
<TextBlock Text="times" Margin="3,0,0,0" FontSize="12" FontWeight="Light" Foreground="{Binding objForegroundColor}"></TextBlock>
</StackPanel>
</StackPanel>
<StackPanel VerticalAlignment="Stretch" Grid.Column="2" Margin="0,0,0,0" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="Time:" FontSize="16" Foreground="{Binding objForegroundColor}" VerticalAlignment="Bottom" FontWeight="SemiLight"></TextBlock>
<TextBlock Text="{Binding strTestDuration}" Margin="5,0,0,0" FontSize="18" VerticalAlignment="Bottom" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
</StackPanel>
<StackPanel Margin="0,2,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="Points:" FontSize="16" Margin="0,0,0,0" VerticalAlignment="Bottom" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
<TextBlock Text="{Binding objCustomTestPaper.TotalMarks}" Margin="5,0,0,0" VerticalAlignment="Bottom" FontSize="18" Foreground="{Binding objForegroundColor}" FontWeight="SemiLight"></TextBlock>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
It is working fine and loads data successfully but When I press back button the data remains in the memory (not usable) and keeps on increasing at various visits to the page. I don't know how how to clear the items of the GridView when OnNavigationFrom(,) method is called. I am trying to use objGridView.Items.Clear() but it throws some HRXXXX exception.

XAML datagrid datatemplate

I'm going through the Windows 8 Bing Translator Walkthrough
I was able to follow everything except the XAML part. I'm very new to XAML. Below is what the walkthrough appears to recommend, however VS2012 indicated the markup is invalid, and the error displayed says "the property "content" is set more than once". Is this the only issue? Where this is set more than once?
<GridView ItemTemplate="{StaticResource TweetTemplate}" SelectionMode="None" ItemsSource="{Binding tweets}"></GridView>
<DataTemplate x:Key="TweetTemplate">
<Grid>
<Rectangle Fill="#FFDA713F" HorizontalAlignment="Left" Height="115" Margin="10,11,0,0"
VerticalAlignment="Top" Width="455" RadiusX="20" RadiusY="20"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="50"
Margin="176,12,0,0" TextWrapping="Wrap" x:Name="txtTweet"
Text="{Binding Title}" VerticalAlignment="Top" Width="277" FontSize="12"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="50"
Margin="176,72,0,0" TextWrapping="Wrap" x:Name="txtTrans"
Text="{Binding translatedText}" VerticalAlignment="Top" Width="277"
FontSize="12"/>
<Image Source="{Binding ImageUri}" HorizontalAlignment="Left" Height="89"
Margin="20,20,0,0" VerticalAlignment="Top" Width="116"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="17"
Margin="24,109,0,0" TextWrapping="Wrap" Text="{Binding Author}"
VerticalAlignment="Top" Width="150" FontSize="10"/>
</Grid>
</DataTemplate>
...and no sooner do I post the question, I find the answer. the above needs to be arranged as follows:
Note that from the example in the link provided above the author used RefreshAppBarButtonStyle. This was changed to AppBarButtonStyle. I;m not sure I fully understand the xaml page yet, but at least I have a working framework to diagnose.
<Page.Resources>
<DataTemplate x:Key="TweetTemplate">
<Grid>
<Rectangle Fill="#FFDA713F" HorizontalAlignment="Left" Height="115" Margin="10,11,0,0" VerticalAlignment="Top" Width="455" RadiusX="20" RadiusY="20"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="50" Margin="176,12,0,0" TextWrapping="Wrap" x:Name="txtTweet" Text="{Binding Title}" VerticalAlignment="Top" Width="277" FontSize="12"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="50" Margin="176,72,0,0" TextWrapping="Wrap" x:Name="txtTrans" Text="{Binding translatedText}" VerticalAlignment="Top" Width="277" FontSize="12"/>
<Image Source="{Binding ImageUri}" HorizontalAlignment="Left" Height="89" Margin="20,20,0,0" VerticalAlignment="Top" Width="116"/>
<TextBlock Foreground="White" HorizontalAlignment="Left" Height="17" Margin="24,109,0,0" TextWrapping="Wrap" Text="{Binding Author}" VerticalAlignment="Top" Width="150" FontSize="10"/>
</Grid>
</DataTemplate>
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<GridView ItemTemplate="{StaticResource TweetTemplate}" SelectionMode="None" ItemsSource="{Binding tweets}"></GridView>
</Grid>
<Page.BottomAppBar>
<AppBar x:Name="bottomAppBar" Padding="10,0,10,0">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock x:Name="txtPrompt" Text="Search Term: " Height="24" FontSize="24"></TextBlock>
<TextBox x:Name="txtSearchTerm" Width="300" Height="24"></TextBox>
<Button Style="{StaticResource AppBarButtonStyle}" Click="Button_Click_1" />
</StackPanel>
</Grid>
</AppBar>
</Page.BottomAppBar>
Hope this is also of use to someone else.
Paul