First Item always dessapear

2 posts, 0 answers
  1. Ricardo
    Ricardo avatar
    5 posts
    Member since:
    Feb 2013

    Posted 01 Nov 2013 Link to this post

    Sorry *disappear



    Hello! I'm using your amazing controls for my Windows Phone Application.


    I need to download several images from Windows Phone Library and my code runs fine but the DataBoundListBox does not load the preview image of  my collection of images.







    I tried to use a standard ListBox and my collection is displayed correctly.







    Could you help me?







    I'm using RX Framework







    XAML:







    <telerikPrimitives:RadDataBoundListBox IsCheckModeActive="True" IsCheckModeEnabled="True" ItemsSource="{Binding Images}" ItemTemplate="{StaticResource MediaLbraryPictureItemTemplate}" ItemAnimationMode="PlayOnAdd" IsAsyncBalanceEnabled="True" CheckModeDeactivatedOnBackButton="False" >



        <telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>



         <telerikPrimitives:DynamicGridVirtualizationStrategyDefinition Orientation="Horizontal"/>



        </telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>



       



       </telerikPrimitives:RadDataBoundListBox>











    C# Code



     protected override async void OnActivate()



            {

                var synchContext = new SynchronizationContextScheduler(System.Threading.SynchronizationContext.Current);



                library = new MediaLibrary();



                CheckedImages = new ObservableCollection<object>();



                Images = new ObservableCollection<Providers.Models.ImageItem>();



                await Task.Delay(500);



               



                library.Pictures.ToObservable()



                     .ObserveOn(synchContext)



                     .Subscribe(pic =>



                     {



                         try



                         {



                             BitmapImage bmp;



                             bmp = new BitmapImage();



                             var thumb = pic.GetThumbnail();



                             if (thumb != null)



                             {



                                 bmp.CreateOptions = BitmapCreateOptions.None;



                                 bmp.SetSource(thumb);



                                 Providers.Models.ImageItem item = new Providers.Models.ImageItem



                                 {



                                     ID = pic.GetHashCode(),



                                     Thumbnail = bmp



                                 };



                                 Images.Add(item);



                                 thumb = null;



                                 bmp = null;



                                 Debug.WriteLine("ItemAdded");



                             }

                         }



                         catch (Exception ex)



                         {

                             var smsservice = IoC.Get<IMessageBoxService>();



                             var result = smsservice.Show("Sorry. Something happend wrong, Would you like to  send us a report?", "ERROR", System.Windows.MessageBoxButton.OK);

                             if (result == System.Windows.MessageBoxResult.OK)



                             {



                                 var reportservice = IoC.Get<IDeviceReportService>();



                                 reportservice.showReport(ex);



                             }



                         }



                       



                     });



                base.OnActivate();



            }










  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 06 Nov 2013 Link to this post

    Hello Ricardo,

    Thanks for writing and for the attached screenshot.

    Can you please try explicitly setting the size of the Image element within your Item Template and let us know if this issue persists?

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top