Feeds

Build a Silverlight media player

Going for gold

Build a business case: developing custom apps

First remove the Default.html, Web.Config, Default.html.js and Silverlight.js files. The silverlight.js file is no longer required - this functionality is replaced by Silverlight Streaming.

Add some JavaScript that can be called when the application loads - add a file called Player.js as follows (the createDelegate snippet is just some glue that used to come from Silverlight.js).

Silverlight.createDelegate = function(instance, method) {
    return function() {
    return method.apply(instance, arguments);
    }
}

function onLoad(sender, context, source)
{
        var scene = new ChildOfMine.Page();
        scene.handleLoad(sender, context, source);
}

Then create a manifest.xml file that loads the XAML and calls the onLoad function defined above.

<SilverlightApp>
        <version>1.0</version> 
        <source>Page.xaml</source>
                <onLoad>onLoad</onLoad> 
        <jsOrder>
                <js>Page.xaml.js</js> 
                <js>Player.js</js> 
        </jsOrder>
</SilverlightApp>

You can now ZIP up the files and upload to Silverlight Streaming - a process described in detail in my earlier article.

To see the application running using the Silverlight Streaming IFRAME invoker click on this link.

Wrapping it up

Traditionally graphic designers use a tool like Photoshop then "throw their design over the wall" to developers who are responsible for cutting the graphics into the application. The design very rarely works exactly as intended and considerable rework is required if the design changes. The combination of Expression and Visual Studio offers a way to close the gap between the two camps.®

Thanks to Helen Yousaf for permission to use her copyright material in this article.

Rob Blackwell is director of R&D for Active Web Solutions who worked with the Royal National Lifeboat Institute (RNLI) to build its award winning Sea Safety tracking system. You can keep up with Rob here.

Bridging the IT gap between rising business demands and ageing tools

More from The Register

next story
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
prev story

Whitepapers

Designing a Defense for Mobile Applications
Learn about the various considerations for defending mobile applications - from the application architecture itself to the myriad testing technologies.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Top 8 considerations to enable and simplify mobility
In this whitepaper learn how to successfully add mobile capabilities simply and cost effectively.
Seven Steps to Software Security
Seven practical steps you can begin to take today to secure your applications and prevent the damages a successful cyber-attack can cause.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.