title: Windows Phone List box flickering when panning
body: <p>I'm having some issues with flickering when panning a Panorama app, the lists box starts blinking, as you can see in this video: <a href="http://www.screenr.com/Aiy8" rel="nofollow">http://www.screenr.com/Aiy8</a></p>
  
  <p>XAML Code:</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage 
      x:Class="PanoramaApp5.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
      xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
      xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
      d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
      FontFamily="{StaticResource PhoneFontFamilyNormal}"
      FontSize="{StaticResource PhoneFontSizeNormal}"
      Foreground="{StaticResource PhoneForegroundBrush}"
      SupportedOrientations="Portrait"  Orientation="Portrait"
      shell:SystemTray.IsVisible="True" shell:SystemTray.BackgroundColor="Transparent"
  shell:SystemTray.Opacity="0"&gt;
  
      &lt;!--LayoutRoot is the root grid where all page content is placed--&gt;
      &lt;Grid x:Name="LayoutRoot" Background="Transparent"&gt;
  
          &lt;!--Panorama control--&gt;
          &lt;controls:Panorama FontSize="20" Foreground="White" Loaded="Panorama_Loaded" Title="Envato Stats" Background="{x:Null}"&gt;
              &lt;controls:Panorama.TitleTemplate&gt;  
                  &lt;DataTemplate&gt;
                      &lt;Image Source="/PanoramaApp5;component/Images/logo.png"  Margin="14,105,0,10" HorizontalAlignment="Left" Name="logo" Stretch="Fill" VerticalAlignment="Top" Width="700" Height="70"/&gt;
                      &lt;!--&lt;TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" FontSize="100" Margin="10,50,0,0" /&gt;--&gt;
                  &lt;/DataTemplate&gt;
  
              &lt;/controls:Panorama.TitleTemplate&gt;
  &lt;controls:PanoramaItem Header="recent sales" Margin="0,-20,0,0"&gt;
                  &lt;!--Double line list with image placeholder and text wrapping--&gt;
                  &lt;ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}" Width="435" Height="Auto"&gt;
                      &lt;ListBox.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;StackPanel Orientation="Horizontal" Margin="0,0,0,17"&gt;
                                  &lt;StackPanel Width="auto" MaxWidth="440"&gt;
                                      &lt;TextBlock Text="{Binding LineOne}" TextWrapping="Wrap"  Style="{StaticResource PhoneTextLargeStyle}" /&gt;
                                      &lt;TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,1,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /&gt;
                                      &lt;TextBlock Text="{Binding LineThree}" TextWrapping="Wrap" Margin="12,1,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/StackPanel&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListBox.ItemTemplate&gt;
                  &lt;/ListBox&gt;
              &lt;/controls:PanoramaItem&gt;
  &lt;/controls:Panorama&gt;
  
      &lt;/Grid&gt;
  
  &lt;/phone:PhoneApplicationPage&gt;
  </code></pre>
  
  <p>And this is the C# code for binding</p>
  
  <pre><code>public void LoadRecent(object sender, DownloadStringCompletedEventArgs e)
          {
              try // In case the user is blocked by the API
              {
                  XDocument document = XDocument.Parse(e.Result);
  
                  // Get the XML nodes
                  IEnumerable&lt;XElement&gt; item =
                          from el in document.Descendants("item")
                          select el;
                  IEnumerable&lt;XElement&gt; amount =
                          from el in document.Descendants("amount")
                          select el;
                  IEnumerable&lt;XElement&gt; rate =
                          from el in document.Descendants("rate")
                          select el;
                  IEnumerable&lt;XElement&gt; soldAt =
                          from el in document.Descendants("sold-at")
                          select el;
  
                  int i = 0;
  
                  foreach (XElement el in document.Descendants("amount"))
                  {
                      DateTime mydate = DateTime.ParseExact(soldAt.ElementAt&lt;XElement&gt;(i).Value, "ddd MMM dd HH:mm:ss zzz yyyy", System.Globalization.CultureInfo.InvariantCulture);
  
                      this.Items.Add(new ItemViewModel() { LineOne = item.ElementAt&lt;XElement&gt;(i).Value, LineTwo = "Amount: $" + amount.ElementAt&lt;XElement&gt;(i).Value + string.Format(" at the rate {0:P0}", float.Parse(rate.ElementAt&lt;XElement&gt;(i).Value)), LineThree = soldAt.ElementAt&lt;XElement&gt;(i).Value });
                      i++;
                  }
              }
              catch { }
              this.IsDataLoaded = true;
          }
  </code></pre>
  
  <p><strong>Update</strong>: it seems that if the Application Bar Mode is set to "Minimized" the flickering issues dissapear, if I set it to "Default" Mode the flickering starts again, anyone got any clues why is this behave like that? And if it's possible to fix it.</p>