locked
flipview not working properly RRS feed

  • Question

  •  public sealed partial class Page11 : Page
        {
            public Page11()
            {
                this.InitializeComponent();
                Task foo = flipviewload();
    
            }
     public async Task flipviewload()
            {
                // Add code to perform some action here.
                FileOpenPicker openPicker = new FileOpenPicker();
                openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
                openPicker.ViewMode = PickerViewMode.Thumbnail;
                
                // Filter to include a sample subset of file types.
                openPicker.FileTypeFilter.Clear();
                openPicker.FileTypeFilter.Add(".bmp");
                openPicker.FileTypeFilter.Add(".png");
                openPicker.FileTypeFilter.Add(".jpeg");
                openPicker.FileTypeFilter.Add(".jpg");
                
                var files = await openPicker.PickMultipleFilesAsync();
                var images = new List<BitmapImage>();
               
                if (files != null)
                {
                    //foreach (StorageFile Images in files)
                    foreach (var file in files)
                    {
                        IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.Read);
                        using (IRandomAccessStream filestream = await file.OpenAsync(FileAccessMode.Read))
                        {
                            BitmapImage bitmapImage = new BitmapImage();
                            await bitmapImage.SetSourceAsync(fileStream);
                            images.Add(bitmapImage);
                        }
                    }
                }
                flpView.ItemsSource = images;
            }
        }

      <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <FlipView x:Name="flpView" Grid.Row="1" Margin="10, 10, 10, 10">
                <FlipView.ItemTemplate>
                    <DataTemplate>
                        <Image Stretch="UniformToFill" Source="{Binding}" />
                    </DataTemplate>
                </FlipView.ItemTemplate>
            </FlipView>
    
        </Grid>

    i want windows 8.1 official app photos  , that's working method . one file select automatically all files select and working flip view controls
    • Moved by Caillen Monday, January 6, 2014 9:22 AM
    Friday, January 3, 2014 1:26 AM

Answers

  • Hi SENTIL,

    While using FileOpenPicker, you gain the access privilege for only one file but not a folder. I would suggest you use FolderOpenPicker to gain the access for a whole folder and then you can add the image belong to this folder to your FilpView control.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, January 7, 2014 1:55 AM
    Moderator

All replies

  • Hi SENTIL,

    I'm moving your question to Windows Store Apps forums where you might get more help.

    Thanks for your understanding.


    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, January 6, 2014 9:23 AM
  • Hi SENTIL,

    While using FileOpenPicker, you gain the access privilege for only one file but not a folder. I would suggest you use FolderOpenPicker to gain the access for a whole folder and then you can add the image belong to this folder to your FilpView control.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, January 7, 2014 1:55 AM
    Moderator