title: Bind listview image source to image (Sqlite/ UWP/ C#)
body: <p>The following code can add images from a database to a listview, however I would like to bind the image property to the pictures in XAML using Image Source rather than use listview1.Items.Add. Can this code be easily modified to do this or do I have to go about this another way. Hopefully this isn't a stupid question to ask and I would appreciate any help.       </p>
  
  <pre><code>public async void showImage()
      {
          var query = GetAll();
  
          foreach (var stuff in query)
          {
              string FileName;
              FileName = stuff.RecipeImage;
              var file = await
              Windows.Storage.KnownFolders.PicturesLibrary.GetFileAsync(FileName);
              var stream = await file.OpenReadAsync();
              var bitmapImage = new BitmapImage();
              bitmapImage.SetSource(stream);
  
              Image ctrlImage = new Image();
              ctrlImage.Source = bitmapImage;
              ctrlImage.Height = 50;
              ctrlImage.Width = 50;
              ctrlImage.Stretch = Stretch.UniformToFill;
  
              listView1.Items.Add(ctrlImage);
          }
      }
  </code></pre>
  
  <p>I need to add the image to the item source that is already used for my database which contains: </p>
  
  <pre><code>public class AddRecipe
  {
      [PrimaryKey,AutoIncrement]
      public int ID { get; set; }
      public string RecipeName { get; set; }
      public string RecipeImage { get; set; }
  } 
  
   &lt;ListView x:Name="listView" HorizontalAlignment="Left" Height="493" Margin="725,60,0,0" VerticalAlignment="Top" Width="528" IsItemClickEnabled="True" SelectionMode="None" ItemClick="listView_SelectionChanged" FontSize="26.667"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate &gt;
                  &lt;StackPanel Orientation="Vertical"  Margin="4"&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;TextBlock Text="{Binding RecipeName}" Foreground="Black"/&gt;
                      &lt;/StackPanel&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;TextBlock Text="{Binding MealType}" Foreground="Black"/&gt;
                      &lt;/StackPanel&gt;
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  </code></pre>