Page 1 of 1

Customizing Progress bar

Posted: Wed Oct 11, 2017 5:21 pm
by JohnBaljian

Is there a way to customize the initial Progress bar (Loading bar) ?


Re: Customizing Progress bar

Posted: Thu Oct 12, 2017 8:14 am
by TaterJuice
Still waiting for a reply on that:

My current workaround is to make a Wrapper CSHTML5 app with no dependencies, and just have it display an animated loading animation while it loads the actual CSHTML5 app and then displays it, once loaded. This still shows the default CSHTML5 initial initialization\loading bar, but only for a moment while it loads the new "loading" animation. Then, the inner CSHTML5 project loads hidden, behind my initial loading animation.

This works, more or less, but I don't think is a permanent solution.
It would be great if the CSHTML5 guys could implement the XAML\WPF Progressbar control, use it to replace the default loading bar with a XAML progressbar, and then allowed users to Style the progressbar in the App.xaml file.

Alternately, remember that this loading animation is only displayed while your Application is initializing (loading App.xaml\App.xaml.cs and MainPage.xaml\MainPage.xaml.cs and related references. This means you can speed up the initialization (reducing the time that ugly grey progressbar is visible) by having as FEW references and imported Namespaces as possible in both your App.xaml\App.xaml.cs and MainPage.xaml\MainPage.xaml.cs, and then load your dependencies in child controls\page navigation functions.

Something like this should work:

Code: Select all

public MainPage()
    Loaded += MainPage_Loaded;

private void MainPage_Loaded(object sender, RoutedEventArgs e)
    var ctrlWReferencesAndDependencies = MyFullNameSpace.Factory.CreateControlInstance<MyFullNameSpace.Controls.ControlWithReferencesAndDependencies>();
    this.Content = ctrlWReferencesAndDependencies;

The downside to this alternate approach is that Global Styles (like those defined in App.XAML) also take up initialization time, and the more Styles you remove from App.xaml to make initialization faster, the more segmented your code becomes with Styles defined elsewhere throughout your application, rather in the App ResourceDictionary. You may just want to make a separate CSHML5 assembly just for your Styles and other App Resources, and then reference that assembly inside of the controls which use them, instead of putting them all in App.xaml.

Re: Customizing Progress bar

Posted: Tue Oct 17, 2017 7:31 am
by TaterJuice
JS-Admin has posted a solution for customizing the Progress Bar!