Piya
Piya

Reputation: 93

How to scroll images horizontally in windows phone 8

I am developing simple windows phone application.Can any one please tell me what code should we write to scroll images left to right? and if all images coming from Facebook account

Upvotes: 1

Views: 2479

Answers (2)

Jaihind
Jaihind

Reputation: 2778

Make a list of all facebook images and use listbox control to show all images from facebook for scroll images left to right change ListBox ItemsPanel property.

<ListBox
    Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Auto">
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <StackPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding FacebookImages}" Stretch = "Fill"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

Upvotes: 5

Julien
Julien

Reputation: 61

Yo scroll image left to right, you need to write something like that:

<ScrollViewer>
   <StackPanel Orientation="Horizontal">
      .. put all your <Image Source="..." />
   </StackPanel>
</ScrollViewer>

Upvotes: 1

Related Questions