This is a migrated thread and some comments may be shown as answers.

Binding To a Pré-Load Image Collection?

1 Answer 30 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Joao Santos
Top achievements
Rank 1
Joao Santos asked on 20 Apr 2010, 01:21 PM
Im tring to binding my pre-loaded image Collection to CoverFlow but images is loding state forever?

there is my code:

OpenFileDialog dlg = new OpenFileDialog(); 
            dlg.Filter = "Arquivos (*.jpg)|*.jpg"
            dlg.Multiselect = true
            dlg.ShowDialog(); 
            ImageData ImageData = new ImageData(); 
            BitmapImage bitmap = new BitmapImage(); 
 
            ImageTools.IO.Jpeg.JpegDecoder decoder = new ImageTools.IO.Jpeg.JpegDecoder(); 
 
            List<ImageTools.Image> ImageList = new List<ImageTools.Image>(); 
 
            foreach (FileInfo finfo in dlg.Files) 
            { 
                ImageTools.Image img = new ImageTools.Image(); 
                decoder.Decode(img, finfo.OpenRead()); 
                img = ImageTools.Image.Resize(img, 120, 90, new ImageTools.Filtering.NearestNeighborResizer()); 
                ImageList.Add(img);   
            } 
 
             
            List<System.Windows.Controls.Image> FinalImageList = new List<System.Windows.Controls.Image>(); 
 
            foreach(ImageTools.Image img in ImageList) 
            { 
                System.Windows.Controls.Image i = new System.Windows.Controls.Image(); 
                i.Width = img.Width; 
                i.Height = img.Height; 
                i.Source = img.ToBitmap(); 
                i.Margin = new Thickness(5,5,5,5); 
                i.Source = img.ToBitmap(); 
                FinalImageList.Add(i); 
            } 
 
            CoverFlow.ItemsSource = FinalImageList; 
        } 
 

and my xaml:

<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    x:Class="PhotoStudio.MainPage" 
    Width="640" Height="480"
 
    <Grid x:Name="LayoutRoot" Background="White"
        <Button x:Name="btnAddImage" Height="25" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top" Width="179" Content="Adicionar Imagens" Click="btnAddImage_Click"/> 
        <telerikNavigation:RadCoverFlow x:Name="CoverFlow" Height="435" Margin="8,0,8,8" VerticalAlignment="Bottom"/> 
    </Grid> 
</UserControl> 

Help plz!!!






1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Apr 2010, 04:37 PM
Hello Joao,

 What I would suggest you is to wrap your images in ContentPresenters. This will stop the Loading indication of the CoverFlow control.

Hope this helps!

Sincerely yours,
Miroslav Nedyalkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
CoverFlow
Asked by
Joao Santos
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or