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

First Item always dessapear

1 Answer 34 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ricardo
Top achievements
Rank 1
Ricardo asked on 01 Nov 2013, 08:24 PM

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();



        }










1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 06 Nov 2013, 10:02 AM
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.
Tags
DataBoundListBox
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or