Hi
I would like to use the SFShimmer control all over the app especially when we load list of items.
We use the xamarin collectionView all over and looking at various examples I am not sure how the shimmer control should be used when using a collectionView.
Would it be possible to load an example on how to use the SFShimmer control with a collection view or point me to a blog or article. We use xaml no code behind.
Many thanks
Hi
thank you very much for your sample .Perfect!
Hi Eswaran ,
Thanks for the sample and works perfectly however when I try without hardcoding the "IsActive" with 5 seconds but actually setting it to either true of false in the call , the shimmer stays loaded all the time,
I have attached a small sample (just android) and you can see yourself?
On 1 page the shimmer does not load at all , and on the other the shimmer despite being set to false is still there.
Am I missing the obvious , the "IsActive" should be used to switch on or off
Many thanks
<shimmer:SfShimmer x:Name="shimmer"
VerticalOptions="Fill"
IsActive="{Binding Path=BindingContext.IsActive, Source={x:Reference CollectionView}}" > |
xmlns:viewModels="clr-namespace:ShimmerCol.ViewModels;assembly=ShimmerCol"
x:DataType="viewModels:ShimmerCollectionViewPageViewModel" |
hi Eswaran,
thank you so much for your sample and clarification.
The one thing I dont get it is why we need " Device.StartTimer(TimeSpan.FromSeconds" unless I understand it wrongly we are actually hardcoding how long we want the shimmer to last
I was expecting the shimmer to start when Active=true and ending with Active=false but without using any timer!
Some calls it might take a split second others 2 secs others 3 seconds, hence I was expecting the IsActive to act like the "IsBusy" flag if you like
Am I missing something here?
thanks again for wonderful support
Hi there,
thanks for your reply , that makes perfect sense.
It is not my intention to drag this thread and grateful that you answer but to put to the test I simply added
an await task.delay(5000) at the top the method and removed the Device.StartTimer but the shimmer didnt load.
Regards
mobileguy
Hi Eswaran,
thank you for your reply.Unless I totally misunderstood the concept of the shimmer control, I think the current implementation is flawed, let me explain why.
In Xamarin as you know we have a familiar concept of "IsBusy" now it's typical that when you perform an action/call at the beginning of your method you declare "IsBusy=true" and when done becomes "IsBusy=False"
Using this concept above I was expecting the shimmer control to adhere to this rule and therefore the "IsActive" flag was actually dictating the showing of the shimmer control in the same way as "IsBusy" works with other controls.
From what you are saying only when the ItemsSource is updated the shimmer control comes into play.
Given what you said and my understanding I truly dont see how this control can actually work in a real world application.
Many thanks for your time.