Xamarin Forms Grid IsVisbile binding only works in one way

I noticed a strange behavior with my XAML page. This is my PageContent. I’m running the app in the iOS Simulator.

            <RowDefinition Height="*"/>

        <Grid IsVisible="{Binding IsBusy, Converter={StaticResource BooleanReverseVisibilityConverter}}">
            <!-- Main content -->

        <Grid IsVisible="{Binding IsBusy}">
            <!-- Busy indicator -->
            <Label Text="Doing some stuff..."/>

I have my main content in the upper grid. While page is doing stuff, the main grid should be invisible and the busy grid schould become visible.

For know, only the main content becomes invisible, however the busy grid stays invisible as well.

This is my binding property.

private bool _isBusy = false;
        public bool IsBusy
            get => _isBusy;
                if (_isBusy == value) return;
                _isBusy = value;

I do set the IsBusy variable in an AsyncCommand (also tried a normal Command). The example is shown below.


CalculateCommand = new AsyncCommand(async () => await CalculateAction(), (t) => 


private async Task CalculateAction()
            IsBusy= true;
                //Do some calculation

                await ShellNavigationManager.GoToAsync(string.Format("{0}?cid={1}", ShellRoute.CalculationResultPage.ToString(), culc.Id), false);
                IsCalculating = false;

            catch (Exception exc)
                await Application.Current.MainPage.DisplayAlert(
                    string.Format(Strings.DialogUnexpectedErrorOccurredFormatedContent, exc.Message),

                IsBusy= false;


I guess it has something to do with the thread. I tried to invoke the IsBusy property in the main thread.

Device.BeginInvokeOnMainThread(async () =>
                        IsBusy = true;

This seems to work, however this takes a while. The calculation is almost done until the invoke sets the visual UI to the current state. I’m kind of lost here. Thanks!


I figured it out. I seemed to be a bug in Visual Studio. I just cut (ctrl + x) and paste the whole XAML code again. Since that, it’s working as expected. No code changes.. strange, but glad it’s working now.

Leave a Reply

Your email address will not be published. Required fields are marked *