0xbadf00d
0xbadf00d

Reputation: 18178

WPF SplashScreen with an UserControl

I'm using the WPF SplashScreen-Class (defined in System.Windows Namespace). The constructor expects a 'resourceName' parameter.

Is there any opportunity to specify an UserControl, instead of an image file? If this is not possible: Is there any way to save an UserControl into an image file?

// Assembly WindowsBase.dll, v2.0.50727

using System;
using System.Reflection;
using System.Security;

namespace System.Windows
{
    public class SplashScreen
    {
        public SplashScreen(string resourceName);
        [SecurityCritical]
        public SplashScreen(Assembly resourceAssembly, string resourceName);

        [SecurityCritical]
        public void Close(TimeSpan fadeoutDuration);
        [SecurityCritical]
        public void Show(bool autoClose);
    }
}

Upvotes: 0

Views: 1440

Answers (1)

Kent Boogaart
Kent Boogaart

Reputation: 178660

The whole point of using an image rather than a control is to avoid the cost of loading up WPF assemblies and infrastructure prior to getting the splash screen up. Thus, the user gets more feedback as quickly as possible when starting your application.

If you don't need any dynamism or interactivity in your splash screen, you can simply create a layered image file (using PaintdotNET or Photoshop for example) and generate a static image from that (jpeg/png). The advantage of using a layered image file is that you can easily designate layers to contain information that changes periodically, such as a version number. You could even have your build process generate the static image with the appropriate version number substituted.

Upvotes: 2

Related Questions