Windows Phone 8.1 FlipView for automatic photo browsing

Source: Internet
Author: User

The FlipView control is also a collection control, but unlike a control such as a ListView, the ListView control displays multiple items at one time, while FlipView displays only one item at a time. Flip through the items on the Windows Phone with the default left and right swipe, or swipe up or down.

Today, small dreams use Flipview controls and timers to give you the ability to automatically browse the image.

The front code is as follows:

<flipview name= "FlipView" ><flipview.itemtemplate><datatemplate><image Name= "Image" Source= "{ Binding ImageSource} "></Image></DataTemplate></FlipView.ItemTemplate></FlipView>

The background code is as follows:

 Public classimage{ Public stringImageSource {Get;Set; }//Picture Path}protected Override voidonnavigatedto (NavigationEventArgs e) {List<Image> list =NewList<image>(); list. ADD (NewImage {imagesource = "iamge/1. jpg "}); List. ADD (NewImage {imagesource = "iamge/2. jpg "}); List. ADD (NewImage {imagesource = "iamge/3. jpg "}); Flipview. ItemsSource= list;//add a photo path as an object source for an Flipview control project image control//Fvstoryboard.begin ();DispatcherTimer _timer =NewDispatcherTimer ();//Define a timer_timer. Interval = Timespan.fromseconds (1.0); _timer. Tick+ = (sender, ET) =//Flipview The index of the currently selected item in the control loop{if(Flipview. SelectedIndex < Flipview. items.count–1) Flipview. SelectedIndex++;ElseFlipview. SelectedIndex=0;}); _timer. Start ();}

Windows Phone 8.1 FlipView automate photo browsing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.