title: How to Highlight the result from context sensitive search in windows phone 7?
body: <p>I need to to Highlight the search result according to the text that is entered in the text box in windows phone 7,</p>
  
  <p><img src="https://i.stack.imgur.com/Wv4V8.png" alt="enter image description here"></p>
  
  <p>the usual wpf code is not working in windows phone 7. .  Somebody say how to achieve this in windows phone 7</p>
  
  <p>Actually this is the xaml Listbox I'm using to populate the Contact list,</p>
  
  <pre><code>    &lt;ListBox Name="ContactList" ItemsSource="{Binding}" Margin="14,85,14,28" Foreground="White" SizeChanged="ContactList_SizeChanged"&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;StackPanel Orientation="Horizontal"&gt;
                          &lt;Border BorderThickness="2" HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="{StaticResource PhoneAccentBrush}" &gt;
                              &lt;Image Source="{Binding Converter={StaticResource ContactPictureConverter}}" Width="48" Height="48" Stretch="Fill" Name="img1" /&gt;
                          &lt;/Border&gt;
                          &lt;TextBlock Name="ContactResults" Text="{Binding Path=DisplayName, Mode=OneWay}" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Margin="18,8,0,0" /&gt;
                      &lt;/StackPanel&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
          &lt;/ListBox&gt;
          &lt;TextBox Name="contactFilterString" Margin="0,0,0,528" TextChanged="contactFilterString_TextChanged" /&gt;
  </code></pre>
  
  <p>C# Code,</p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Net;
      using System.Windows;
      //using System.Windows.Controls;
      using System.Windows.Documents;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Windows.Media.Animation;
      using System.Windows.Shapes;
      using Microsoft.Phone.Controls;
      using Microsoft.Phone.UserData;
      using Newtonsoft.Json;
      using Newtonsoft.Json.Linq;
      using System.Collections.ObjectModel;
      using Microsoft.Phone.Shell;
      using System.Windows.Controls;
      using System.Windows.Media.Imaging;
      using System.Text.RegularExpressions;
  
      namespace SmartContactsApp
      {
  public partial class MainPage : PhoneApplicationPage
  {
      private List&lt;Address&gt; lstAddress = new List&lt;Address&gt;();
      public string addressJson = string.Empty;
  
      // Constructor
      public MainPage()
      {
          InitializeComponent();
  
          this.Loaded += new RoutedEventHandler(MainPage_Loaded);
          CreateSecondaryTile();
      }
  
      /// &lt;summary&gt;
      /// To List all the Contacts. . .
      /// &lt;/summary&gt;
      private void ContactListing()
      {
          ContactList.DataContext = null;
          Contacts cons = new Contacts();
          cons.SearchCompleted += new EventHandler&lt;ContactsSearchEventArgs&gt;(Contacts_SearchCompleted);
          cons.SearchAsync(contactFilterString.Text, FilterKind.DisplayName, "Contacts");
      }
  
      /// &lt;summary&gt;
      /// To Fetch All Contacts from Mobile Contacts. . .
      /// &lt;/summary&gt;
      /// &lt;param name="sender"&gt;&lt;/param&gt;
      /// &lt;param name="e"&gt;&lt;/param&gt;
      public void Contacts_SearchCompleted(object sender, ContactsSearchEventArgs e)
      {
          try
          {
              ContactList.DataContext = e.Results;
  
          }
          catch (Exception)
          {
              throw;
          }
      }
  
      private void contactFilterString_TextChanged(object sender, TextChangedEventArgs e)
      {
          ContactListing();
      }
      }
  </code></pre>
  
  <p>How to highlight in this,</p>
  
  <p>Thanks in advance!</p>