Here is the sample code . Hope it helps.
In buttonPage.xaml,
<!--
<grid x:name="ContentPanel" grid.row="1" margin="12,0,12,0" xmlns:x="#unknown">
<stackpanel>
<Button Content="Button1" Click="Button_Click"/>
<Button Content="Button2" Click="Button_Click"/>
<Button Content="Button3" Click="Button_Click"/>
<Button Content="Button4" Click="Button_Click"/>
</stackpanel>
</grid>
In buttonPage.xaml.cs,
private void Button_Click(object sender, RoutedEventArgs e)
{
string c=(sender as Button).Content.ToString().Substrin((sender as Button).Content.ToString().Length-1);
NavigationService.Navigate(new Uri("/ImagesPage.xaml?ImageNo="+c,UriKind.RelativeOrAbsolute));
}
ImagePage.xaml,
<!--ContentPanel - place additional content here-->
<grid x:name="ContentPanel" grid.row="1" margin="0,0,0,0" xmlns:x="#unknown">
<scrollviewer x:name="ImgScrollViewer" scrollviewer.horizontalscrollbarvisibility="Visible" verticalscrollbarvisibility="Auto">
<stackpanel orientation="Horizontal" x:name="ImagesSP" scrollviewer.manipulationmode="Control" scrollviewer.horizontalscrollbarvisibility="Visible" scrollviewer.verticalscrollbarvisibility="Auto" loaded="ImagesSP_Loaded">
<!--<StackPanel.RenderTransform>
<TranslateTransform Y="550"/>
</StackPanel.RenderTransform>-->
<image source="Images\MediumGray.png" width="480" height="400" stretch="Fill" />
<image source="Images\msweb-brand.png" width="480" height="400" stretch="Fill" />
<image source="Images\videos.png" width="480" height="400" stretch="Fill" />
<image source="Images\MediumGray.png" width="480" height="400" stretch="Fill" />
</stackpanel>
</scrollviewer>
</grid>
ImagePage.xaml.cs:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
NavigationContext.QueryString.TryGetValue("ImageNo", out imageNo);
}
private void ImagesSP_Loaded(object sender, RoutedEventArgs e)
{
double offset = 0;
int cnt = 1;
foreach (Image img in ImagesSP.Children)
{
cnt++;
offset += img.Width;
if (cnt == Convert.ToInt32(imageNo))
break;
}
ImgScrollViewer.ScrollToHorizontalOffset(offset);
}