Is it possible to show a busy indicator when searching for occurrences of a text in the PdfViewer? I'm using a custom toolbar but I'm having trouble getting the indicator to show. Here's the code for my search bar, which is just modified from syncfusion examples.
XAML:
<busyindicator:SfBusyIndicator x:Name="BusyIndicator" IsVisible="true" Title="Searching..." AnimationType="DoubleCircle" />
<Entry Grid.Column="1" x:Name="textSearchEntry" FontSize="18" HorizontalOptions="Fill" VerticalOptions="Center" Text="{Binding SearchedText}" TextColor="Black" Completed="OnEntryCompleted">
<Entry.Behaviors>
<behavior:EventToCommandBehavior EventName="Completed" Command="{Binding SearchNextTextCommand , Source={x:Reference Name=pdfViewerControl}}" CommandParameter="{Binding Source ={x:Reference Name=textSearchEntry}, Path=Text}" />
</Entry.Behaviors>
</Entry>
XAML.CS
public void OnEntryCompleted(object sender, EventArgs e)
{
BusyIndicator.IsBusy = true;
}
private void pdfViewerControl_SearchCompleted(object sender, TextSearchCompletedEventArgs args)
{
BusyIndicator.IsBusy = false;
bool isNoMoreOccurrenceFound = args.NoMoreOccurrence;
bool isNoMatchFound = args.NoMatchFound;
if (isNoMatchFound)
{
DisplayAlert("No Match Found", "No instance of the text has been found.", "OK");
}
}