mauisyncfusionindicator

MAUI Syncfusion ListView How to set busy indicator color?


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>

Solution

  • 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>