1

I'm using Syncfusion's SfListView in my MAUI app. While lazy loading a busy indicator is shown. How can I set the color of the loading indicator?

<listView:SfListView Grid.Row="2" Grid.Column="0"
                     x:Name="ListView"
                     ItemsSource="{Binding Results}"
                     AutoFitMode="Height"
                     LoadMoreOption="Auto"
                     LoadMoreCommand="{Binding LoadMoreItemsCommand}"
                     LoadMoreCommandParameter="{Binding Source={x:Reference ListView}}"
                     IsVisible="{Binding IsAvailable}" >

    <listView:SfListView.ItemTemplate>
        <DataTemplate x:DataType="contracts:MyDto">
                <VerticalStackLayout Margin="0,0,0,30">

                    <VerticalStackLayout.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MyViewModel}}, Path=TapEntryCommand}"
                                              CommandParameter="{Binding}"/>
                    </VerticalStackLayout.GestureRecognizers>

                    <HorizontalStackLayout>
                        <Label Text="(" />
                        <Label Text="{Binding Date, StringFormat='{0:dd.MM.yyyy}'}" />
                        <Label Text=")" />
                    </HorizontalStackLayout>

                </VerticalStackLayout>
        </DataTemplate>
    </listView:SfListView.ItemTemplate>

</listView:SfListView>
6
  • Where is the busy indicator? Commented Sep 11, 2023 at 14:26
  • @Julian The indicator is shown an the bottom of the SfListView while loading more data. Commented Sep 11, 2023 at 14:29
  • So you didn't add any SfBusyIndicator instance yourself? Commented Sep 11, 2023 at 14:30
  • @Julian Nope, it is the indicator out of the SfListView -box. Commented Sep 11, 2023 at 14:38
  • 1
    According to the docs, you can set a custom LoadMoreTemplate. It doesn't say anything about customizing the indicator color. I would expect that it uses the primary color or a system color for this. Commented Sep 11, 2023 at 14:38

1 Answer 1

1

It works using the DataTemplate...

<listView:SfListView Grid.Row="2" Grid.Column="0"
                     x:Name="ListView"
                     ItemsSource="{Binding Results}"
                     AutoFitMode="Height"
                     LoadMoreOption="Auto"
                     LoadMoreCommand="{Binding LoadMoreItemsCommand}"
                     LoadMoreCommandParameter="{Binding Source={x:Reference ListView}}"
                     IsVisible="{Binding IsAvailable}" >
    <listView:SfListView.LoadMoreTemplate>
        <DataTemplate>
            <listView:ListViewLoadMoreIndicator
                IsRunning="{Binding IsLazyLoading, Source={x:Reference Name=ListView}}"
                IsVisible="{Binding IsLazyLoading, Source={x:Reference Name=ListView}}" 
                Color="{StaticResource PrimaryColor}" />
        </DataTemplate>
    </listView:SfListView.LoadMoreTemplate>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.