Cross Platform Activity Indicator...

Hi,

First off, I am a newbie with Xamarin.

Well, I am trying to develop an cross platform application with a form that submits the data to a RESTful (WebAPI) service using using a Xamarin Forms (Portable) template in VS 2015 Community Ed.

I have a ContentPage (XAML) that captures the data and calls a common public Method ("CallWebAPI" - a single method that manages calls to all my WebMethods) that I have different Class that sends the data to the WebAPI service and gives the result. This part is working fine. However, I would now like to add an ActivityIndicator that will show-up whenever the app is communicating with / waiting for the WebAPI.

Questions:
1) Is there a way by which I can handle this within my "CallWebAPI" method? (so that it can be handled at just 1 place).
2) If the answer to question 1 is a "NO", please advice on the best way forward.
3) Once the ActivityIndicator starts working, how do I replace the default animation with a custom video? (I have a 48x48 pixel 1second MP4 video).

Thanks in advance for your help.

Cheers!

Answers

  • SebastianKruseSebastianKruse USMember ✭✭✭
    1. You can use a static property with a PropertyChanged event somewhere in your project as Binding for the "IsVisible" for the ActivityIndicator. You can find some help with the term "BindingProxy" in google.
    2. ^
    3. With a custom renderer is should be possible to replace the default animation but I never did it before.
Sign In or Register to comment.