Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a label in front of my textblock
    primarykey
    data
    text
    <p>I have a list which gets data from a web service but the data needs a label or another textblock to say what that data is. Is there a way of inserting this within this listbox?</p> <p>so my desired outcome would be </p> <p>"HIN Number:" - then display the textblock which is bound to HINNumber</p> <p>"Category Letter:" - then display the textblock which is bound to categoryLetter</p> <p>"Category 1:" - then display the textblockwhich is bound to category1</p> <p>"Category 2:" - then display the textblockwhich is bound to category2</p> <p>"Category 3:" - then display the textblockwhich is bound to category3</p> <p>I thought I could just align another textblock up next to the matching databound textblock but some values are null and so the position of the listbox is constantly changing so this wouldnt work.</p> <pre><code> &lt;ListBox x:Name="HINList" Margin="0,300,-12,0" ItemsSource="{Binding Details}"&gt; &lt;ListBox.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel Margin="0,0,0,17" Width="432"&gt; &lt;TextBlock Text="{Binding HINNumber}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextExtraLargeStyle}"/&gt; &lt;TextBlock Text="{Binding CategoryLetter}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextNormalStyle}"/&gt; &lt;TextBlock Text="{Binding Category1}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextNormalStyle}"/&gt; &lt;TextBlock Text="{Binding Category2}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextNormalStyle}"/&gt; &lt;TextBlock Text="{Binding Category3}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextNormalStyle}"/&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload