This is a migrated thread and some comments may be shown as answers.

Is it possible to use the BusyIndicator without the Content Property?

1 Answer 250 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 22 Sep 2017, 05:10 PM
I have a bunch of ActivityIndicators in my application already, but the native ActivityIndicator doesn't scale well on iOS. Is it possible to just use the BusyIndicator without content? I don't want to have to refactor my views if I do not have to.

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 22 Sep 2017, 08:02 PM
Hello Trevor,

To achieve what you're looking for, you can position the RadBusyIndicator on top of your content. Then, within the RadBusyIndicator's content, place an element and bind its WidthRequest and HeightRequest to the page's Width and Height properties.

Pasted below is a demo I've written that will overlays the RadBusyIndicator on top the the green BoxView by toggling the IsVisible and IsBusy properties:

XAML:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Name="MyPage" xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives"
             x:Class="TrevorDemo.Portable.StartPage">
 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
         
        <BoxView WidthRequest="200" HeightRequest="200" BackgroundColor="Green" HorizontalOptions="Center" VerticalOptions="Center"></BoxView>
         
        <telerikPrimitives:RadBusyIndicator x:Name="BusyIndicator" IsVisible="False">
            <telerikPrimitives:RadBusyIndicator.Content>
                <Grid BindingContext="{x:Reference MyPage}" HeightRequest="{Binding Height}" WidthRequest="{Binding Width}">
                     
                </Grid>
            </telerikPrimitives:RadBusyIndicator.Content>
        </telerikPrimitives:RadBusyIndicator>
         
        <Button Text="Toggle BusyIndicator" Clicked="Button_OnClicked" Grid.Row="1"/>
    </Grid>
     
</ContentPage>

Code behind:

namespace TrevorDemo.Portable
{
    public partial class StartPage : ContentPage
    {
        public StartPage()
        {
            InitializeComponent();
        }
 
        private void Button_OnClicked(object sender, EventArgs e)
        {
            BusyIndicator.IsVisible = !BusyIndicator.IsVisible;
            BusyIndicator.IsBusy = !BusyIndicator.IsBusy;
        }
    }
}



Wrapping Up

If this answers your question, you can let me know by selecting the ticket's "Mark as resolved" button. If you have any further difficulty, please share your code so that we can investigate further.

Thank you for contacting Support and for choosing UI for Xamarin.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
BusyIndicator
Asked by
Trevor
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or