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

How to Use Busyindicator Inside List View Cell Image control

1 Answer 138 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Rajsanil
Top achievements
Rank 1
Rajsanil asked on 27 Aug 2017, 05:40 PM

How to Use Busyindicator Inside List View Cell Image control can you Provide the sample code for the same

MY scenario is listview cell has image control and the image is loading from remote server i want show busy indicator on each cell till the image downloads

 

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 28 Aug 2017, 06:27 PM
Hello Rajsanil,

You can how to show/hide the busy indicator by adding a boolean property to your model and bind the RadBusyIndicator's IsBusy property to that model property.

For example, let's say your model has an IsImageDownloading property:

public class MyModel : INotifyPropertyChanged
{
     // ... other properties
 
    private bool isImageDownloading;
    public bool IsImageDownloading
    {
        get { return isImageDownloading; }
        set { isImageDownloading = value; OnPropertyChanged(); }
    }
 
    // INPC
}


Then in your template cell, you bind IsBusy to that property

<listView:ListViewTemplateCell>
    <listView:ListViewTemplateCell.View>
        <primitives:RadBusyIndicator IsBusy="{Binding IsImageDownloading}">
            <primitives:RadBusyIndicator.Content>
                <Image Source="{Binding ImageUrl}"/>
            </primitives:RadBusyIndicator.Content>
        </primitives:RadBusyIndicator>
    </listView:ListViewTemplateCell.View>
</listView:ListViewTemplateCell>


Regarding how to write code that determines if the image is downloading or not, that is outside the scope of Telerik controls. You can ask on StackOverflow or Xamarin forums. there are several different ways you can do this, you'll need to determine which one makes the most sense for you (the most common is to manually download the image using HttpClient).

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
BusyIndicator
Asked by
Rajsanil
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or