SplashScreen for WPF Applications?

Using (or providing) Microsoft.NET Classes
Post Reply
User avatar
Dick Bowman
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm
Contact:

SplashScreen for WPF Applications?

Post by Dick Bowman »

Hopefully the answer is going to be easier than the question...

One of the issues I have with using WPF to build the GUI of an application is that it takes a very long time to get itself loaded and started (first load especially - I'm guessing stuff gets cached because restarts are a lot quicker).

In the good old days I'd use GreetBitmap and all would be better. I guess I could still use GreetBitmap, but I decided to see what .NET/WPF had to offer.

And I'm (as so often) bamboozled.

I find a SplashScreen class and I see a little code snippet...

SplashScreen splashScreen = new SplashScreen("SplashScreenImage.bmp");
splashScreen.Show(true);

which I figure is simple enough for even me to translate to APL, so ...

⎕USING←,⊂ ',WindowsBase.dll'
⎕NEW System.Windows.SplashScreen⊂w ⍝ where <w> is a suitable filename
DOMAIN ERROR
⎕NEW System.Windows.SplashScreen⊂w


and a bit of abuse in the Status Window...

System.ArgumentNullException: Value cannot be null.
Parameter name: resourceAssembly
( at System.Windows.SplashScreen..ctor(Assembly resourceAssembly, String resourceName))

Microsoft tells me...

resourceName
Type: System.String
The name of the embedded resource.

Which is where I think reality and my grasp of it go their separate ways. If I understand correctly (and searching finds another similarly-lost soul) what this means is that I can't fill my SplashScreen with any old file - it has to be a file known to my "project" as a "resource".

So, in words of one syllable - where have I gone wrong? Or is what I want to do undoable?
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
norbertjurkiewicz84
Posts: 62
Joined: Mon Nov 01, 2010 7:26 pm

Re: SplashScreen for WPF Applications?

Post by norbertjurkiewicz84 »

I've done a little research on this myself and found exactly what you have. One other thing I came across was the delay involved in running a WPF splashscreen. It seems that on a cold boot of the .NET framework, the splashscreen can take upwards of 10-20 seconds before it shows. Certain parts of the .NET framework need to load first.

I do think that the default splashscreen is inadequate. It would be very nice to have a dynamic splash with a way to update a status message in the portion of it. It might prove useful to have a community effort to build a new tool that would be a nice update or replacement.


Just food for thought.

Norbert.
(It's the little things that make the difference :-)
Post Reply