2013-07-02 175 views
1

我有一個形象的滾動視圖,我導入從遠程服務器映像,但我想自動滾動的圖像,幫助我如何滾動圖像進行圖像滾動自動自動滾動視圖8

我的XAML代碼鑑於

<ScrollViewer x:Name="ImgScrollViewer" 
       ScrollViewer.HorizontalScrollBarVisibility="Auto" 
       VerticalScrollBarVisibility="Auto" > 
    <StackPanel Orientation="Horizontal" x:Name="ImagesSP" 
       ScrollViewer.ManipulationMode="Control" 
       ScrollViewer.HorizontalScrollBarVisibility="Visible" 
       ScrollViewer.VerticalScrollBarVisibility="Auto" 
       Height="124" Width="3690" 
       Loaded="ImagesSP_Loaded_1" > 
     <!--<StackPanel.RenderTransform> 
       <TranslateTransform Y="550"/> 
      </StackPanel.RenderTransform--> 

     <Image Source="http://technomindtech.com/1tele-pixel.com/ad/logo_banner.jpg" Width="500" Height="45" Stretch="Fill" VerticalAlignment="Top" /> 
     <Image Source="http://technomindtech.com/1tele-pixel.com/ad/images.jpeg" Width="500" Height="45" Stretch="Fill" VerticalAlignment="Top" /> 
     <Image Source="http://technomindtech.com/1tele-pixel.com/ad/banner.jpg" Width="500" Height="45" Stretch="Fill" VerticalAlignment="Top" /> 
     <Image Source="http://technomindtech.com/1tele-pixel.com/ad/images.jpeg" Width="500" Height="45" Stretch="Fill" VerticalAlignment="Top" /> 
     <Image Source="Images\MediumGray.png" Width="480" Height="400" Stretch="Fill" /> 
    </StackPanel> 
</ScrollViewer> 

我的CS碼

namespace BogheApp 
{ 
    public partial class MainPage : BasePage 
    { 
     public MainPage() 
     { 
      InitializeComponent(); 
     } 

     private void ImagesSP_Loaded_1(object sender, RoutedEventArgs e) 
     { 

     } 
    } 
} 

回答

1

你需要計算要滾動到偏移,然後用ScrollToVerticalOffset(your_offset_value)方法。現在,如何計算偏移量取決於您想要實現的目標,因此需要更多的細節來回答這個問題。