Skip to main content
Home Forums General Silverlight Getting Started First Application
4 replies. Latest Post by Patience on August 11, 2007.
(0)
Patience
Member
20 points
17 Posts
08-11-2007 2:26 PM |
Hi,
I'm Patience. I was wondering if anyone could give me a quick summary of what I have to do to create a website that uses Silverlight 1.0 RC. I've already downloaded and installed it, but I don't want to use Blend 2 August Preview, due to the fact that if I use it and deploy what I've made, I have to put up a note which says that the website was created using pre-release software, and thus might not function properly. Could anyone please help?
y_makram
Contributor
6172 points
1,233 Posts
08-11-2007 2:52 PM |
The most basic Silverlight application consistes of the following files:
HTML file that hosts the Silverlight application, it needs to contain a DIV with a unique ID and invokes the JS code that generates the Ssilverlight plugin, example:
<body> <div id="SilverlightControlHost" > <script type="text/javascript"> createSilverlight(); </script> </div> </body>
The createSilverlight() should invoke Silverlight.createObjectEx defined in Silverlight.js file distributed with the SDK, example:
function createSilverlight(){ Silverlight.createObjectEx({ source: "Page.xaml", parentElement: document.getElementById("SilverlightControlHost"), id: "SilverlightControl", properties: { width: "100%", height: "100%", version: "1.1", enableHtmlAccess: "true" }, events: {onLoad: OnLoaded } });}
The third file is the XAML file that describes the UI. The most basic file looks like this:
<Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="parentCanvas" Loaded="Page_Loaded" Width="800" Height="600" Background="White" >
</Canvas>
And optionally you will need JS files that contains the logic behind your application.
08-11-2007 3:05 PM |
Thanks, Y_Makram. But, I can create an entire website like this, correct?
08-11-2007 4:22 PM |
Yes, Neither Blend nor VS to create Silverlight 1.0 applications, but they will make your application alot easier to implement.
08-11-2007 5:37 PM |
Thanks a lot! I guess I'll continue studying it, and build and deploy my first app. Thanks again, Y_Makram!