wpf application not loading image in windows 10 while in windows 7 it works -
we have wpf application runs on windows 7 , windows 10, on pc , tablet.
we have window use splash screen, , when trying open during application in windows 7 shows image , in windows shows the blank window.
we tried load image static resource, open splash screen in thread, use 7kb images instead of 1mb, still not works.
we tried open splash @ start of application , works.
we tried open new project 1mb images , works, don't know what's happing during run of application prevent loading image in windows 10.
the splash screen .xaml code:
<window .... windowstate="maximized" topmost="true" windowstyle="none" height="1080" width="1980"> <window.resources> <bitmapimage x:key="loadingdrill" urisource="pack://application:,,,/resources/splash.png"/> </window.resources> <grid x:name="me"> <image source="{staticresource loadingdrill}"/> </grid> </window> the .cs code:
private static splashviewer singleton; public static void closesplash() { if (singleton != null) { singleton.close(); singleton = null; } } public static void showsplash() { if (singleton == null) { singleton = new splashviewer(); singleton.closed += singleton_closed; singleton.show(); } } private static void singleton_closed(object sender, eventargs e) { singleton = null; } public splashviewer() { initializecomponent(); me.datacontext = this; } open splash screen:
splashviewer.showsplash(); /// ///do something... /// splashviewer.closesplash(); another try:
system.windows.application.current.dispatcher.invoke((action)(() => { splashviewer.showsplash(); })); anyone idea it?
we end using devexpress dxsplashscreen, works.
if know's why doesn't work regular window we'll glad know too..
Comments
Post a Comment