I am having trouble setting the visibility of the ActivityIndicator.
When IsBusy = true in view model, the indicator is not visible in the view. How to solve it?
sample code in view model (MyViewModel):
private bool _IsBusy;
public bool IsBusy
{
get { return _IsBusy; }
set { SetProperty(ref _IsBusy, value); }
}
void MyDataChanged(object sender, ObjectChangeEventArgs e)
{
this.IsBusy = true;
CommitChanges(); //takes aprox. 3 seconds
this.IsBusy = false;
}
My xaml in View:
(...)
xmlns:viewmodels="clr-namespace:Project.ViewModels"
x:DataType="viewmodels:MyViewModel"
(...)
<ActivityIndicator Grid.Row="1" Grid.Column="0" HeightRequest="100" WidthRequest="100" HorizontalOptions="Center" IsVisible="{Binding IsBusy}" IsRunning="True"/>
(...)