locked
I need a sample of Automatic vertical scroll up images ,that could stop for a tick then continue ????

    Question

  • I need a sample of Automatic vertical scroll up images ,that could stop for a tick then continue ????
    Saturday, October 18, 2014 2:33 PM

Answers

  • Hi Khlood,

    FlipView is supported by windows phone 8.1, do you target your project on windows phone 8? You can see this on the Requirements section on this reference. http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.flipview.aspx. Work around is to download and use the Visual Studio 2013 for Windows express. Otherwise you will need to use other control by yourself.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, October 27, 2014 1:47 AM
    Moderator

All replies

  • Hi Khlood,

    According to your description, I assume you want to build an image viewer in windows store app. I would recommend you use FlipView control and DispatcherTimer control. I build a project to show how to, please see the following code.

    In XAML

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <StackPanel>
                <FlipView x:Name="flipview1">
                    <FlipView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel Orientation="Vertical"/>
                        </ItemsPanelTemplate>
                    </FlipView.ItemsPanel>
                    <FlipView.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Image Width="480" Height="270" Source="{Binding URL}" Stretch="UniformToFill"/>
                                <Border Background="#A5000000" Height="80" VerticalAlignment="Bottom">
                                    <TextBlock Text="{Binding Title}" FontFamily="Segoe UI" FontSize="26.667" 
                                          Foreground="#CCFFFFFF" Padding="15,20"/>
                                </Border>
                            </Grid>
                        </DataTemplate>
                    </FlipView.ItemTemplate>
                </FlipView>
            </StackPanel>
    </Grid>
    

    In XAML.cs

    public sealed partial class MainPage : Page
        {
            private List<CustomImage> cimages;
            private DispatcherTimer timer;
            private int index;
            public MainPage()
            {
                this.InitializeComponent();
                cimages = new List<CustomImage>();
                cimages.Add(new CustomImage() { Title = "aaaaa", URL = "/Images/1.png" });
                cimages.Add(new CustomImage() { Title = "bbbbb", URL = "/Images/aaaaaaa.png" });
                cimages.Add(new CustomImage() { Title = "ccccc", URL = "/Images/bbbbb.png" });
                cimages.Add(new CustomImage() { Title = "ddddd", URL = "/Images/ccccc.png" });
                cimages.Add(new CustomImage() { Title = "eeeee", URL = "/Images/dddddd.png" });
                cimages.Add(new CustomImage() { Title = "fffff", URL = "/Images/eeeeee.png" });
                cimages.Add(new CustomImage() { Title = "ggggg", URL = "/Images/fffffff.png" });
                cimages.Add(new CustomImage() { Title = "hhhhh", URL = "/Images/hhhhhhh.png" });
                cimages.Add(new CustomImage() { Title = "aaaaa", URL = "/Images/iiiiiii.png" });
                cimages.Add(new CustomImage() { Title = "iiiii", URL = "/Images/jjjjjjj.png" });
                cimages.Add(new CustomImage() { Title = "jjjjj", URL = "/Images/smallTile-sdk.png" });
                timer = new DispatcherTimer();
                timer.Interval = TimeSpan.FromSeconds(2);
                timer.Tick += timer_Tick;
            }
            void timer_Tick(object sender, object e)
            {
                flipview1.SelectedIndex = index++;
            }
            private void Page_Loaded(object sender, RoutedEventArgs e)
            {
                flipview1.ItemsSource = cimages;
                index = flipview1.SelectedIndex;
                timer.Start();
            }
        }
        public class CustomImage
        {
            public string Title { get; set; }
            public string URL { get; set; }
        }
    

    If I misunderstand you, please feel free to let me know.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, October 20, 2014 9:03 AM
    Moderator
  • I am trying this code, there is an error  happen " Error The type 'FlipView' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. ..........\Documents\Visual Studio 2012\Projects\...............
     "

    Is there something missed from project or code ???
    Monday, October 20, 2014 4:46 PM
  • Hi Khlood,

    It seems you are running the old version of visual studio. The visual studio cannot find the FlipView control in this version. I would recommend you install the newest version of visual studio to develop windows store app. Download from Visual Studio 2013 for windows express and try the code again.

    If you still have questions, please feel free to let me know.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, October 23, 2014 8:12 AM
    Moderator
  • Hi Herro 

    I am working on visual studio Express 2012 for windows phone, is that Sufficed ??? 

    Thursday, October 23, 2014 9:38 AM
  • Hi Khlood,

    FlipView is supported by windows phone 8.1, do you target your project on windows phone 8? You can see this on the Requirements section on this reference. http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.flipview.aspx. Work around is to download and use the Visual Studio 2013 for Windows express. Otherwise you will need to use other control by yourself.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, October 27, 2014 1:47 AM
    Moderator