[SOLVED] Customizing Progress bar

JohnBaljian
Posts: 6
Joined: Wed May 11, 2016 12:57 pm

[SOLVED] Customizing Progress bar

Postby JohnBaljian » Wed Oct 11, 2017 5:21 pm

Greetings,

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

thanks

TaterJuice
Posts: 86
Joined: Thu Mar 16, 2017 5:40 am

Re: Customizing Progress bar

Postby TaterJuice » Thu Oct 12, 2017 8:14 am

Still waiting for a reply on that:

http://forums.cshtml5.com/viewtopic.php?f=4&t=8141

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.

TaterJuice
Posts: 86
Joined: Thu Mar 16, 2017 5:40 am

Re: Customizing Progress bar

Postby TaterJuice » Tue Oct 17, 2017 7:31 am

JS-Admin has posted a solution for customizing the Progress Bar!

http://forums.cshtml5.com/viewtopic.php?f=4&t=8141&p=9613#p9613


Return to “General Discussion and Other”

Who is online

Users browsing this forum: No registered users and 2 guests