Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Xamarin Forms Showing Loader

$
0
0

Im showing a loader on Click of a button

Code Behind

    async void onLoginClicked(object sender, EventArgs args)
    {

        if (IsLoading) return;
        IsLoading = true;

        if (Utilities.LoginUser(_userPin))
        {
           //Do Something
        }
        else
        {
            await DisplayAlert("Login Error", "Invalid Pin", "Ok");
        }
        IsLoading = false;
    }

XAML

    "<ActivityIndicator x:Name="actIndicator2"
                   AbsoluteLayout.LayoutFlags="PositionProportional"
                   AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1"
                   IsVisible="{Binding IsLoading}"
                   IsRunning="{Binding IsLoading}"/>"

My issue here is loader is shown after it performs the "Login Operation".

Its an async method how can i make it visible as soon as its clicked


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>