In lightswitch, the logon window is automatically provided by the system and does not support custom logon interfaces,ProgramA big white screen is displayed, with the login name, password, and button in the middle. This is really ugly. It is really unbearable for the login interface (applying some skin styles. Do it yourself.
Switch ls to file mode, enter the client project, find application. CS under usercode, and add the followingCodeThe principle is to find the container object in the system's built-in login window through object reference and forcibly implant the background. The Code is as follows:
Using system; using system. LINQ; using system. io; using system. io. isolatedstorage; using system. collections. generic; using Microsoft. lightswitch; using Microsoft. lightswitch. framework. client; using Microsoft. lightswitch. presentation; using Microsoft. lightswitch. presentation. extensions; using system. windows. controls; using system. reflection; using Microsoft. lightswitch. runtime. shell. internal. implementation; Pu BLIC partial class application {frame rootframe = NULL; partial void application_initialize () {Microsoft. lightswitch. threading. dispatchers. main. begininvoke () => {rootframe = (PAGE) (contentpresenter) system. windows. application. current. rootvisual ). content ). content as frame; If (rootframe! = NULL) rootframe. navigated + = new system. windows. navigation. navigatedeventhandler (rootframe_navigated) ;});} void rootframe_navigated (Object sender, system. windows. navigation. navigationeventargs e) {If (E. content is loginpage) {// prepare image, that is laying in the resources folder as embedded resource system. windows. media. imaging. bitmapimage image = new system. windows. media. imaging. bitmapimage (); image. setsource (assembly. getexecutingassembly (). getmanifestresourcestream (this. getType (), "bg.png"); image mylogo = new image () {source = image, stretch = system. windows. media. stretch. uniform}; mylogo. setvalue (grid. columnspanproperty, 5); mylogo. setvalue (grid. rowspanproperty, 7); mylogo. stretch = system. windows. media. stretch. fill; // stretch // Add image grid = (loginpage) E. content ). content as grid; grid. children. insert (0, mylogo); // not add, for background rootframe. navigated-= rootframe_navigated ;}}}
Run it. Check the effect
The background image was modified based on the qq sl version.