11 Comments

image Silverlight po defaultu dolazi sa loader splash ekranom, koji je sve samo ne lijep. Neznam za čitatelje ovog teksta, ali ja čim vidim gradijente, odnosno prijelaze, još u kružnom obliku, dobijem iznenadnu želju za skakanjem sa vrha zgrade. Srećom, da ne bi slučajno došlo do realizacije tih želja gledajući brojna učitavanja Silverlight aplikacija, zamjena ekrana učitavanja je vrlo jednostavna.

Iz sljedećeg prikaza može se vidjeti slijed učitavanja aplikacije:

image

Splash screen i događaji koji ispisuju postotak učitavanja su u biti jedna XAML datoteka i Javascript metoda koja se poziva na promjenu postotka učitavanja i vrši interakciju sa elementima prikazanom XAML ekranu.

Postupak izrade izgleda ovako:

1. U jednoj XAML datoteci je potrebno pripremiti izgled ekrana. Ovdje se nalazi primjer takve datoteke,

2. Javascript metoda služi za prikaz i animiranje tog ekrana (potrebno dodati u posebnu JS datoteku i referencirati ju iz Head elementa od web stranice):

function SourceDownloadProgressChanged(s, e) {
    var bartext = s.findname("bartext");
    var bar = s.findname("bar");
    if (bartext != null || bar != null) {
        var value = Math.round(e.progress * 100)
        bartext.Text = value + "%";
        var newWidth = 3.3 * value;
        bar.Width = Math.round(newWidth)
    }
}

3. Dodatni parametri unutar poziva Silverlight aplkacije (u html/aspx, <object> element):

<param value="preloader.xaml" name="splashscreensource" />
<param value="SourceDownloadProgressChanged" name="onSourceDownloadProgressChanged" />

Comments

Comment by Sueann Franzel

Happy I found this site and I'll be checking back for more of your great content.

Comment by Monitors

This confirms what I thought!

Comment by watch inception online

I always was interested in this topic and still am, appreciate it for posting.

Comment by watch the expendables online

I like this post, enjoyed this one thank you for putting up. "No trumpets sound when the important decisions of our life are made. Destiny is made known silently." by Agnes de Mille.

Comment by watch twilight eclipse online

I've recently started a site, the information you offer on this web site has helped me greatly. Thank you for all of your time & work. "The inner fire is the most important thing mankind possesses." by Edith Sodergran.

Comment by watch despicable me online free

I genuinely enjoy reading on this web site, it has excellent blog posts. "Never fight an inanimate object." by P. J. O'Rourke.

Comment by watch twilight eclipse online

Enjoyed looking at this, very good stuff, regards . "Hereafter, in a better world than this, I shall desire more love and knowledge of you." by William Shakespeare.

Comment by LOLd

Seriously brilliant piece, I loved looking through it. It had quite a few terrific insight. I am bookmarking this site.