1

我不能像Windows Phone中的圖像庫一樣順利交換。顯示圖像交換像Windows Phone中的圖片庫C#

我試過flip gesture listener,它能夠交換圖像但不能平滑交換。

我試圖搜索,但沒有得到任何答案。我試圖以畫廊視圖的方式顯示圖像列表。我從過去3天開始掙扎。如果你給我一些建議或鏈接,請給予幫助。

+1

你的問題並不十分清楚。當你說順利時,你的意思是它不是動畫或動畫是以非常低的幀率運行的? – 2013-04-27 09:12:56

+1

@ dr.mo讓我說清楚。我有一個圖像列表,現在我想查看它像在Windows Phone中的照片庫圖像視圖。我在這裏沒有做任何動畫,我只是將我的圖像從左到右或反之亦然,以查看列表中的所有圖像。我能夠做到這一點,但你在Windows手機畫廊找到的動畫查看圖像,我不能做到這一點,它應該像畫廊一樣工作。請幫助我... – 2013-04-27 09:17:46

+0

@SanghatiMukherjee您想要在一個屏幕後查看其他圖片或列表中的圖片嗎?如果你讓我知道你想要哪一個我有一些想法,可以工作..我會盡力給你的代碼或告訴你如何可以做.. – Apoorva 2013-05-07 04:54:19

回答

1

這是一個簡單的例子,我剛建的向你展示它如何做..希望你能有所幫助

<phone:PhoneApplicationPage xmlns:Controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
x:Class="PhotoChooser.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: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" 
FontFamily="{StaticResource PhoneFontFamilyNormal}" 
FontSize="{StaticResource PhoneFontSizeNormal}" 
Foreground="{StaticResource PhoneForegroundBrush}" 
SupportedOrientations="Portrait" Orientation="Portrait" 
shell:SystemTray.IsVisible="True"> 

<!--LayoutRoot is the root grid where all page content is placed--> 
<Grid x:Name="LayoutRoot" Background="Transparent"> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="Auto"/> 
     <RowDefinition Height="*"/> 
    </Grid.RowDefinitions> 

    <!--TitlePanel contains the name of the application and page title--> 
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> 
     <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/> 
     <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> 
    </StackPanel> 

    <!--ContentPanel - place additional content here--> 
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> 
     <ListBox x:Name="lbImages"> 
      <ListBox.ItemTemplate> 
       <DataTemplate> 
        <Controls:Panorama> 
         <Controls:PanoramaItem> 
          <Image Source="{Binding ImageName}"/> 
         </Controls:PanoramaItem> 
        </Controls:Panorama> 
       </DataTemplate> 
      </ListBox.ItemTemplate> 
     </ListBox> 
    </Grid> 
</Grid> 

與此設計器的類文件是這樣的

public partial class MainPage : PhoneApplicationPage 
{ 
    public MainPage() 
    { 
     InitializeComponent(); 

     PanoramaItem panItem = new PanoramaItem(); 
     List<ImageList> imgList = new List<ImageList>(); 


     imgList.Add(new ImageList() { ImageName = ImagePath.Image4 }); 
     lbImages.ItemsSource = imgList; 
    } 

    public class ImageList 
    { 
     public string ImageName { get; set; } 
    } 
} 

這實際上工作順利,看起來也不錯..有很多方法可以實現你正在嘗試。請讓我知道這是否有效。如果這不適合你,我會建議其他人!