Keeping the user informed of activity
There are two ways to let the user know that your application is working on something time-consuming:
ActivityIndicator
ProgressBar
ActivityIndicator
essentially says, “I’m working on it, but I don’t know how long it will take,” whereas ProgressBar
says, “I’m working on it, and I’m about halfway done.” Let’s explore each of these in a bit more detail.
ActivityIndicator
We’ll start by adding ActivityIndicator
to the login page below the Buttons:
<ActivityIndicator Color="Blue" IsRunning="{Binding ActivityIndicatorIsRunning}" />
Notice that the IsRunning
property is bound to the ActivityIndicatorIsRunning
property. That property is in LoginViewModel
(you’ll remember that we set that file as the binding context):
[ObservableProperty] private bool activityIndicatorIsRunning...