Show Background Image While Loading Silverlight Application - silverlight

I have a Silverlight app that takes a few seconds to display on a webpage. While loading, the user sees a blank space. Is there a way to show some sort of alt text or background image behind the application while it is loading to indicate to the user what is happening?

Check that out :
http://msdn.microsoft.com/en-us/library/cc903962(VS.95).aspx

Based on the above link posted by danbord, I found that this can be accomplished via a splash screen. Basically, the splash screen will be loaded while the .xap is still being downloaded for a silverlight application. This can be implemented as follows:
Create splash screen .xaml file (this can be done in Visual Studio by creating a Silverlight 1.0 JScript page)
Add a splashScreenSource parameter to your object tag in the webpage hosting your silverlight application. This should point to the .xaml file created in step 1.
It is important that the value of the splashscreen param resolve to the correct location of the .xaml file relative to the page the silverlight app is hosted in. For example, if your SplashScreen.xaml file is in your website root, but the page hosting your silverlight app is in a subfolder, you will need to use
<param name="splashScreenSource" value="../SplashScreen.xaml" />
There are also other options that can be added such as attaching an event handler to the onSourceDownloadProgressChanged event to update a progress bar or some other UI animation.

Related

Paste text into application behind my WPF app

I'm creating a WPF application where the user can click on a symbol and the app will paste that symbol into the application behind it (for example, into a web browser's text box or a Word document).
I'm having trouble with being able to remove the focus of my WPF app, so that when I use SendKeys, the symbol will be pasted into the other application. I am using the following code so far, but I don't want the window to hide, just be unfocused.
Clipboard.SetText("{symbol}")
Hide()
Forms.SendKeys.SendWait("^v")
Show()
Can anyone help? Thanks in advance.

Show a Sothink menu on top of a Silverlight iFrame

I have a Sothink menu on a web page and below it is a Silverlight iframe application. Currently the iframe is covering some dropdown menu items.
I have tried solving this problem with z-indexing, windowless, and wmode. I can not change the original code of the application but when I view the source of the iframe's page, I see that the developer commented out the windowless option because it interfered with another part of the program.
The only way I have tried to insert it into my page is through this code:
<iframe src="iframe-code-url.com" frameborder="0" style="background-color:#FFF;" scrolling="yes" width="940px" height="500px" wmode="opaque" windowless="true"></iframe>
I am open to any and all suggestions. I have done a lot of research and I have not found anything.
You must set Windowless=true on the Silverlight host object, not the iFrame. If you can't access the host object, you cant enable Windowless mode and so you cant do what you want.
See here for more on Windowless Silverlight Objects
Ideally, you should host the Silverlight XAP file in the same site as your web page.

How to use .js and .css file in SilverLight application

I am using a customized alert message for my whole application which generates from a .js file and a .css file. I have also used silverlight in my application and shows MessageBox from silverlight with its default design. Now i want to customized that MessageBox in silverlight.
So, can anyone plz help me to know how to add js and css file to silverLight application and how to use it
You can't change the built-in MessageBox style as easily as simply creating your own modal window. There are lots of custom messageboxes about and many have source code.
e.g.
Creating a reusable MessageBox dialog.
Silverlight Modal Dialog With Custom User Controls
Custom MessageBox Control for Silverlight 3
Note: these are all Silverlight solutions, so you are authoring in XAML and with style, not using JS and CSS.
It is also possible to call JS functions on the page from within Silverlight if you think that will be easier for your solution.

Display modal Silverlight popup on HTML button click

I have the following desired workflow: on HTML button click a Silverlight modal popup (dialog) must be displayed. No Silverlight content is displayed before HTML button click and no Silverlight content must be displayed after exiting from modal SL popup.
According to our customer inclination we couldn't use another technology for such popups.
Any thoughts on how to accomplish mentioned workflow?
I'm quite new to Silverlight so all the ideas are highly appreciated.
The requirement is a little unusual, but here goes...
I am assuming you have a Silverlight test project and know enough HTML/JScript to popup a window, as you tagged this question as Silverlight only.
Think of Silverlight as just another component you can put on a web page. Any web page. It can be a small control, or fill a HTML window.
In your case you want to simply put your Silverlight startup code into a html page that a popup window can show. The popup window will be triggered by JScript attached to a button.
The Silverlight startup code is usually generated for you in a HTML test webpage in your Silverlight Webproject. Copy it from there.
If you need more detailed instructions for a specific example, please provide more detail.

opening a silverlight childWindow overlay on the viewport of the browser

I would like place a silverlight contol on an HTML page --- something about the size of a typical calendar control. However when the user selects a day on the control a bigger canvas opens up on top of the containing page --- something like a modal dialog box that you might find with the AJAX.
I'm wondering if this is even possible with Silverlight, or is the silverlight content limited in size to the DIV element on the host page?
UPDATE: after doing some poking around, I think the answer will involve using the ChildWindow control introduced with Silverlight 3. However I'm still at a loss how to have the ChildWindow display ontop of the existing content
I know one way, you will need javascript event on the page itself to expand a silverlight object to fit the whole page then build you silverlight event accordingly.

Resources