locked
Progress bar in StatusBar RRS feed

  • Question

  • Hi there 

    I'm working in a app that handles with information from RestFul calls , and i wanted add some kind of information , so user can understand that page is loading information on background. I have reading about Progressbar , but i have a question how can i put the progressBar apearing on Status bar like the Facebook app do or i can do this in a diff way ?


    Thursday, January 7, 2016 1:40 PM

Answers

  • this is what i did to get it working:

    In Utils.cs I modified displayloading and stopLoading into this:

    public static void displayloading()
            {
                var Shell = Window.Current.Content as Shell;
    
                Shell.toogleLoading();
                
            }
    
            public static void stopLoading()
            {
                var Shell = Window.Current.Content as Shell;
                Shell.toogleLoading();
            }

    i removed the StatusBar since that is only on mobile version avialable. In HomePage.cs I hacked a line to make sure displayRandom on the viewmodel was called:

     protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                base.OnNavigatedTo(e);
                _viewModel.displayRandom();
            }


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Marked as answer by rubemlrm Thursday, January 7, 2016 8:33 PM
    Thursday, January 7, 2016 7:20 PM

All replies

  • For Windows you need to add a progressbar yourself in the view. For Mobile sku there is a system statusbar which you can use with :

    if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
                {
                    await StatusBar.GetForCurrentView().ShowAsync();
                }

    don't forget to reference the Mobile Extension SDK


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, January 7, 2016 1:45 PM
  • And for instance i have a splitview system where my shell.xaml have the progressBar and navigation nav , but my content is in another view that its loaded. How can i access to progressBar and toggle visibility ? 

    I've tried create a function on shel.xaml.cs to toogle progressBard visibility , but looks that dont work :S

    Thursday, January 7, 2016 4:36 PM
  • can you share a demo project or what you have ?

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Thursday, January 7, 2016 6:26 PM
  • There it is http://git.amplifiedcreations.com/rubemlrm/caviiarPhone

    I'm still learning some stuff and the code maybe be lot messy.

    Thursday, January 7, 2016 7:04 PM
  • this is what i did to get it working:

    In Utils.cs I modified displayloading and stopLoading into this:

    public static void displayloading()
            {
                var Shell = Window.Current.Content as Shell;
    
                Shell.toogleLoading();
                
            }
    
            public static void stopLoading()
            {
                var Shell = Window.Current.Content as Shell;
                Shell.toogleLoading();
            }

    i removed the StatusBar since that is only on mobile version avialable. In HomePage.cs I hacked a line to make sure displayRandom on the viewmodel was called:

     protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                base.OnNavigatedTo(e);
                _viewModel.displayRandom();
            }


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Marked as answer by rubemlrm Thursday, January 7, 2016 8:33 PM
    Thursday, January 7, 2016 7:20 PM
  • First of all i want to say that you help was priceless and i hope that you get lots of success on this area =) With your last reply you helped me solve 2 problems that was messing with me because i wasnt able to solve with simple google searchs.
    Thursday, January 7, 2016 8:32 PM