This question is locked. New answers and comments are not allowed.
I have a RadDataboundListbox with lots if images, when I scroll and the item is taken off view, I want to release the image resource (dispose) ... is there any event fired when item is no longer in view or what is the best way to dispose off images scrolled off view?
I want to do this mainly because I notice as I keep scrolling for more images used memory keep growing and even though I havn't got a OOM yet, I believe at some point I will.
Thanks.
I want to do this mainly because I notice as I keep scrolling for more images used memory keep growing and even though I havn't got a OOM yet, I believe at some point I will.
Thanks.
5 Answers, 1 is accepted
0
Hi Olu,
Thanks for writing and for your question.
There is the ItemStateChanged event exposed by RadDataBoundListBox which you can use to understand when a visual items goes into one of the following states:
- Being realized
- Realized
- Being recycled
- Recycled
You can find information about the state in the event arguments provided to the handler method.
You can use this method to free the image resources.
Regards,
Deyan
Telerik
Thanks for writing and for your question.
There is the ItemStateChanged event exposed by RadDataBoundListBox which you can use to understand when a visual items goes into one of the following states:
- Being realized
- Realized
- Being recycled
- Recycled
You can find information about the state in the event arguments provided to the handler method.
You can use this method to free the image resources.
Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Olu
Top achievements
Rank 1
answered on 17 Feb 2014, 02:44 PM
Hi,
Thanks for that.
How can I attach to this event from a DataTemplate declared in ResourceDictionary?
Thanks for that.
How can I attach to this event from a DataTemplate declared in ResourceDictionary?
0
Hi Olu,
Thanks for writing.
Can you please share some more details on your scenario? You can subscribe for events within XAML code but if this is a style in a dictionary, that would not be possible. In such case you will need to programatically access the corresponding control that fires the event and access it.
Regards,
Deyan
Telerik
Thanks for writing.
Can you please share some more details on your scenario? You can subscribe for events within XAML code but if this is a style in a dictionary, that would not be possible. In such case you will need to programatically access the corresponding control that fires the event and access it.
Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Nguyen
Top achievements
Rank 1
answered on 03 Oct 2014, 04:32 AM
Hi,
I have a problem with ItemStateChanged event, I need to get FrameworkElement or UIElement which is Realize or Recycled.
Could you please help me that ????
I have a problem with ItemStateChanged event, I need to get FrameworkElement or UIElement which is Realize or Recycled.
Could you please help me that ????
0
Hello Nguyen,
Generally, modifying UI containers in virtualization scenarios could lead to performance issues as well as unexpected results. Would it be possible to elaborate more on the scenario you are trying to achieve in order to suggest optimal solution.
Regards,
Tsvyatko
Telerik
Generally, modifying UI containers in virtualization scenarios could lead to performance issues as well as unexpected results. Would it be possible to elaborate more on the scenario you are trying to achieve in order to suggest optimal solution.
Regards,
Tsvyatko
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.