When IsBusy is set on a Page, how to get UWP to show a busy indicator on desktop?

JohnHardmanJohnHardman GBUniversity mod

I was soooo close to logging a bug about the busy indicator not showing up on UWP. Then I changed the background color of the navigation bar of my app to white, and there it was. Ridiculously small yes, but it is there (but only on a physical phone, not on desktop).

As I don't want my navigation bar to have a white background, I'm assuming I'll need to create a custom ProgressBarRenderer to get the ProgressBar to show up on phones.

However, my question is - should some form of busy indicator be visible on Windows 10 desktop running a UWP build? If so, where should it be / what should it look like?

Answers

  • NMackayNMackay GBInsider, University mod

    @JohnHardman

    I noticed in UWP, if you don't specify a decent size the indicator doesn't show at all.

    <ActivityIndicator IsRunning="{Binding Busy}"
                                           IsVisible="{Binding Busy}"
                                           AbsoluteLayout.LayoutFlags="PositionProportional"
                                           AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1"
                                           VerticalOptions="CenterAndExpand"
                                           HorizontalOptions="CenterAndExpand">
                            <ActivityIndicator.WidthRequest>
                                <OnPlatform x:TypeArguments="x:Double" iOS="100" Android="100" WinPhone="400" />
                            </ActivityIndicator.WidthRequest>
                            <ActivityIndicator.Color>
                                <OnPlatform x:TypeArguments="Color"
                                            iOS="#39757F" WinPhone="#193375" />
                            </ActivityIndicator.Color>
                        </ActivityIndicator>
    

    I couldn't comment on what it renders to on desktop, ProgressBar at a guess.

    https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/renderers/
    https://msdn.microsoft.com/library/windows/apps/br227529

  • JohnHardmanJohnHardman GBUniversity mod

    After some more thought, I think there's more to this one than another custom renderer, even as a UWP app on phone. Have pinged an email to support.

  • PaulDistonPaulDiston USUniversity ✭✭✭✭

    @JohnHardman Bit late to this but did you get anywhere with showing a busy indicator on a UWP desktop app when the IsBusy property is set on a Page?

  • JohnHardmanJohnHardman GBUniversity mod

    @PaulDiston - I found the Page's IsBusy to be flawed, not just on UWP desktop. Unfortunately, ActivityIndicator is nigh on invisible on UWP, so not a great alternative. I haven't looked into it yet, but wonder if there is a native control or a third-party plugin that would give a better UI/UX.

  • PaulDistonPaulDiston USUniversity ✭✭✭✭
    edited January 2018

    @JohnHardman After a little more digging I found that I can use the same LoadingDialog as I use for Android and iOS, I had prevented it from showing in my converter for Windows (I don't want to use this LoadingDialog for WP8, as I want to use the Busy Indicator just below the StatusBar). I use the following https://github.com/aritchie/userdialogs

  • JohnHardmanJohnHardman GBUniversity mod

    Thanks @PaulDiston - Yes, the aritchie userdialogs would have been my next thing to investigate as well. It's just not bubbled to the top of my to-do list yet :-)

  • CamelCaseMasterCamelCaseMaster USMember ✭✭

    The aritchie userdialogs is really helpful, Works like a charm. Thanks.

Sign In or Register to comment.