所以我有一個編碼問題,我需要幫助,只是把我不知道我在做什麼。僅供參考,我沒有使用手勢偵聽器的工具包。全景和圖像陣列
我有一個3全景項目的全景頁面:BigImageCenter,BigImageLeft,BigImageRight。
在我的應用程序中有一串圖像,將與應用程序一起下載。此全景圖頁面的目標是在頁面底部設置滾動查看器,以小縮略圖顯示應用隨附的圖像列表,並將頁面頂部作爲全景圖項目,如果您向左或向右輕擊圖像,有條不紊地前進(或者如果向左輕彈,則返回)。
此外,如果您點擊底部滾動查看器中的某個縮略圖,它將用該縮略圖圖像替換當前的全景圖像。如果您在全景圖頁面上向左或向右滑動,則會在數組中顯示縮略圖圖像的-1或+1。
您在頁面上看到的第一個圖像是BigImageCenter。
我不必使用3個全景項目,我可能只能以1跳過。但是,當僅使用1進行測試時,通過單擊縮略圖並輕掃全景左側或對,下一張要加載的圖像在改變之前始終是相同的圖像(有意義,因爲我沒有編碼任何數組來動態更改下一個圖像等)。
但是我不知道如何做任何操作:
1)創建其中在全景項第一圖像設置爲X. 2數組)告訴我們,如果用戶輕彈向左或向右設置爲-1或+1 3)設置縮略圖圖像以在點擊時替換當前的全景圖像,然後將數組放到該縮略圖圖像位置。
這裏是全景控制和縮略圖的ScrollViewer兩者的XAML:
<Grid x:Name="ControlPanel" Grid.Row="1" Margin="-8,-22,-49,90">
<controls:Panorama Name="Image_Panorama" Height="auto" Width="auto">
<!--Panorama item one-->
<controls:PanoramaItem>
<Rectangle Height="auto" Width="auto" x:Name="BigImageCenter">
<Rectangle.Fill>
<ImageBrush ImageSource="image030.jpg" />
</Rectangle.Fill>
</Rectangle>
</controls:PanoramaItem>
<controls:PanoramaItem>
<Rectangle Height="auto" Width="auto" x:Name="BigImageLeft">
<Rectangle.Fill>
<ImageBrush ImageSource="pics/image002.jpg" />
</Rectangle.Fill>
</Rectangle>
</controls:PanoramaItem>
<controls:PanoramaItem>
<Rectangle Height="auto" Width="auto" x:Name="BigImageRight">
<Rectangle.Fill>
<ImageBrush ImageSource="pics/image003.jpg" />
</Rectangle.Fill>
</Rectangle>
</controls:PanoramaItem>
</controls:Panorama>
</Grid>
<Grid x:Name="MiniPicturePanel" Grid.Row="1" Margin="0,390,0,0">
<ScrollViewer x:Name="svSmall" Grid.Row="1" HorizontalContentAlignment="Center">
<StackPanel x:Name="smallImages" Orientation="Horizontal" VerticalAlignment="Bottom" Margin="330,0,0,0">
<Rectangle Height="70" Width="110" Margin="0,0,30,0" StrokeThickness="3" MouseLeftButtonUp="smallImage_Tap" Stroke="#FF004080" x:Name="Bat1">
<Rectangle.Fill>
<ImageBrush ImageSource="image030.jpg" />
</Rectangle.Fill>
</Rectangle>
<Rectangle Height="70" Width="110" Margin="0,0,30,0" StrokeThickness="3" MouseLeftButtonUp="smallImage_Tap" Stroke="#FF004080" x:Name="Bat2">
<Rectangle.Fill>
<ImageBrush ImageSource="pics\image002.jpg" />
</Rectangle.Fill>
</Rectangle>
....等等
我現在已經做了一些事情,但不是我的方式d像:
MouseLeftButtonUp =「smallImage_Tap」是一個函數,它將把「BigImageCenter」的全景圖項目更改爲當前矩形的image.fill。我只是不能編碼它來更改當前的數據透視項。我需要幫助。
private void smallImage_Tap(object sender, RoutedEventArgs e) {
BigImageCenter.Fill = (sender as Rectangle).Fill;
如果你想知道爲什麼我使用矩形,這是對我來說,與小縮略圖輕敲時後面的代碼改變圖像的最簡單方法。
而這幾乎是我的代碼隱藏。我真的從零開始做這個動態編碼,並且需要一些幫助來實現這個夢想。
PS:我還需要知道與圖像綁定的數組編號,以便我可以讓用戶「收藏」它並將其放在另一個頁面中。
任何有任何建議嗎?我想我讀過,實際上完成這件事是不可能的?通過這個,我的意思是說,如果我有3個pivotitems,我不能將圖像分配給每個這些項目,並讓他們跳到數組中的那個位置? Arghhh! – topcoderwannabe 2011-06-07 00:01:32