Note that there are some explanatory texts on larger screens.

plurals
  1. POObservableCollection not updating the control
    primarykey
    data
    text
    <p>I am having a Telerik TransitionControl which displays advertisements to to end user. the logic is written in such a way that the ad images will be downloaded asynchronously in the behind. the control will display images as it is available. I am using ObservableCollection to hold the advertisement images.New image information is added to this ObservableCollection when a image is successfully downloaded. However, the Telerik TransitionControl is not getting updated with the new images.</p> <p>I believe the ObservableCollection does not need the OnNotifyPropertyChanged to be called as it will be called internally</p> <p>Code is given below</p> <pre><code>//Inside the AdvertUserControl.xaml.cs ViewModel vm = new ViewModel(); DataContext = vm; this.radControl.SetValue(AdRotatorExtensions.AdRotatorExtensions.ItemsSourceProperty, vm.SquareAdsVertical); </code></pre> <p>//Inside the ViewModel.cs</p> <pre><code> public ReadOnlyObservableCollection&lt;Advert&gt; SquareAdsVertical { get { if (AdsManager.VerticalAds == null) { return null; } return new ReadOnlyObservableCollection&lt;Advert&gt;(AdsManager.VerticalAds); } } // Inside DownloadManager.cs private static ObservableCollection&lt;Advert&gt; adsToShowVertical = new ObservableCollection&lt;Advert&gt;(); public static ObservableCollection&lt;Advert&gt; VerticalAds { get { if (adsToShowVertical != null) return adsToShowVertical; return null; } } public static void OnDownloadComplete(Object sender, AsyncCompletedEventArgs e) { try { if(!e.Cancelled) { if (e.Error == null) { Advert ad = e.UserState as Advert ; adsToShowVertical.Add(ad ); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload