Loading Indicator with message.

betakarthikbetakarthik INMember ✭✭
edited January 2018 in Xamarin.Forms

i am trying to connect mobile via Bluetooth at that time i want to show indicator with message, how can i do this?

Answers

  • adityadeshpandeadityadeshpande Member ✭✭
    edited January 2018

    Try doing this
    in your Xaml

        <Grid>
            <Grid> EveryThing That you have and are going to mask under the loading</Grid>
    
                <!--LOADING GRID START-->
                <Grid
                    BackgroundColor="SlateGray"
                    IsVisible="{Binding ProcessIndicator}"
                    Opacity="0.7">
                    <ActivityIndicator
                        HorizontalOptions="Center"
                        IsRunning="True"
                        VerticalOptions="Center"
                        WidthRequest="150"
                        Color="White" />
                </Grid>
                <!--LOADING GRID ENDS-->
        </Grid>
    

    and in your ViewModel.cs

            private bool _processIndicator;
    
                    public bool ProcessIndicator
                    {
                        get { return _processIndicator; }
                        set { _processIndicator = value; OnPropertyChanged("ProcessIndicator"); }
                    }
    

    and when you start some process or API call set

            ProcessIndicator = true;
            // Do API CALL or Perform Your Operations.
            ProcessIndicator = false;
    

    Should Do The thing.!

  • betakarthikbetakarthik INMember ✭✭

    My problem was I want to show indicator in interface method both the platforms ios and android because there is no direct method for Bluetooth connectivity in xamarin forms so that I was implemented using interfaces during the process of connectivity I want to show indicator.

    could anyone suggest me?

Sign In or Register to comment.