平移

2012-10-22 38 views
2

平移全景照片的應用程序時,我遇到了閃爍的一些問題時,Windows Phone的列表框中閃爍,列表框開始閃爍,你可以在這個視頻中看到:http://www.screenr.com/Aiy8平移

XAML代碼:

<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"> 

    <!--LayoutRoot is the root grid where all page content is placed--> 
    <Grid x:Name="LayoutRoot" Background="Transparent"> 

     <!--Panorama control--> 
     <controls:Panorama FontSize="20" Foreground="White" Loaded="Panorama_Loaded" Title="Envato Stats" Background="{x:Null}"> 
      <controls:Panorama.TitleTemplate> 
       <DataTemplate> 
        <Image Source="/PanoramaApp5;component/Images/logo.png" Margin="14,105,0,10" HorizontalAlignment="Left" Name="logo" Stretch="Fill" VerticalAlignment="Top" Width="700" Height="70"/> 
        <!--<TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" FontSize="100" Margin="10,50,0,0" />--> 
       </DataTemplate> 

      </controls:Panorama.TitleTemplate> 
<controls:PanoramaItem Header="recent sales" Margin="0,-20,0,0"> 
       <!--Double line list with image placeholder and text wrapping--> 
       <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}" Width="435" Height="Auto"> 
        <ListBox.ItemTemplate> 
         <DataTemplate> 
          <StackPanel Orientation="Horizontal" Margin="0,0,0,17"> 
           <StackPanel Width="auto" MaxWidth="440"> 
            <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" /> 
            <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,1,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> 
            <TextBlock Text="{Binding LineThree}" TextWrapping="Wrap" Margin="12,1,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> 
           </StackPanel> 
          </StackPanel> 
         </DataTemplate> 
        </ListBox.ItemTemplate> 
       </ListBox> 
      </controls:PanoramaItem> 
</controls:Panorama> 

    </Grid> 

</phone:PhoneApplicationPage> 

這是結合

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<XElement> item = 
         from el in document.Descendants("item") 
         select el; 
       IEnumerable<XElement> amount = 
         from el in document.Descendants("amount") 
         select el; 
       IEnumerable<XElement> rate = 
         from el in document.Descendants("rate") 
         select el; 
       IEnumerable<XElement> 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<XElement>(i).Value, "ddd MMM dd HH:mm:ss zzz yyyy", System.Globalization.CultureInfo.InvariantCulture); 

        this.Items.Add(new ItemViewModel() { LineOne = item.ElementAt<XElement>(i).Value, LineTwo = "Amount: $" + amount.ElementAt<XElement>(i).Value + string.Format(" at the rate {0:P0}", float.Parse(rate.ElementAt<XElement>(i).Value)), LineThree = soldAt.ElementAt<XElement>(i).Value }); 
        i++; 
       } 
      } 
      catch { } 
      this.IsDataLoaded = true; 
     } 

更新 C#代碼:看來,如果應用A n條模式設置爲「最小化」閃爍問題消失,如果我將其設置爲「默認」模式閃爍再次開始,任何人都有任何線索,爲什麼這樣的行爲?如果可以修復它。

回答

0

解決方案:看起來不透明度是有罪的,而不是讓它變得牢固,我將不透明度設置爲0.99,並且沒有任何問題。