Im tring to binding my pre-loaded image Collection to CoverFlow but images is loding state forever?
there is my code:
and my xaml:
Help plz!!!
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!!!