Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A common base page for using IsBusy property to show a busy indicator.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
<ContentView Content="{Binding Source={x:Reference ContentPage},Path=MainContent}"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">
<!-- Your Busy Indicator (Check out syncfusion's busy indicator) -->
<ContentView Content="{Binding Source={x:Reference ContentPage}, Path=LoadingView}"
IsVisible="{Binding Source={x:Reference ContentPage},Path=IsBusy}"
AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" />
public partial class LoadingPage : ContentPage
public LoadingPage()
public static readonly BindableProperty MainContentProperty =
BindableProperty.Create(nameof(MainContent), typeof(View), typeof(LoadingPage));
public static readonly BindableProperty LoadingContentProperty =
BindableProperty.Create(nameof(LoadingView), typeof(View), typeof(LoadingPage));
public View LoadingView
get => (View) GetValue(LoadingContentProperty);
set => SetValue(LoadingContentProperty, value);
public View MainContent
get { return (View) GetValue(MainContentProperty); }
set { SetValue(MainContentProperty, value); }
protected override void OnBindingContextChanged()
if (MainContent == null)
SetInheritedBindingContext(MainContent, BindingContext);
Copy link

SalihKARAHAN commented Jul 17, 2019

Hi @QiMata
How do you use this base page? Can you share usage of this LoadingPage?

Copy link

QiMata commented Jul 17, 2019

The other pages in the application would inherit from BaseContentPage instead of Content page.

Copy link

Im-PJ commented Jul 20, 2019

Instead of inheriting from BasePage we can also create a controltemplate like shown here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment