Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> &lt;Window.Resources&gt; &lt;DataTemplate x:Key="SearchResultsTemplate"&gt; &lt;Grid Margin="4,0,4,8" Width="446" Height="68"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Border VerticalAlignment="Top" Margin="8" Padding="2" Background="White"&gt; &lt;Image Width="40" Height="40" Source="{Binding Path=Avatar, Mode=OneWay}" /&gt; &lt;/Border&gt; &lt;StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="0,4,0,0"&gt; &lt;TextBlock x:Name="AuthorName" FontWeight="Bold" Text="{Binding Path=Author, Mode=OneWay}" /&gt; &lt;Grid Margin="0,6,0,0"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;RowDefinition Height="2" /&gt; &lt;RowDefinition Height="Auto" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;TextBlock x:Name="Message" TextWrapping="Wrap" /&gt; &lt;/Grid&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/DataTemplate&gt; &lt;/Window.Resources&gt; &lt;ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" BorderThickness="1"&gt; &lt;ItemsControl x:Name="SearchResults" Margin="0,8,0,0" Grid.Row="1" ItemTemplate="{StaticResource SearchResultsTemplate}" /&gt; &lt;/ScrollViewer&gt; </code></pre> <p>Code behind:</p> <pre><code> XDocument xdoc = XDocument.Load("data.xml"); SearchResults.ItemsSource = from item in xdoc.Descendants("Item") where (string)item.Element("Author") == searchInput select new { Author = (string)item.Element("Author"), Message = (string)item.Element("Message"), Avatar = (string)item.Element("Avatar") }; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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