A nice piece of clock control shared by Fons Sonnemans.
Nov
WriteableBitmap Extensions: Drawing Shapes
Nov
Traffic Jam Game
Tess implemented an interesting game called “Traffic Jam”. You target is get your car out of the traffic jam.
Nov
CodeFx – All in one package
CodeFx is an all in one package which contains a lot of useful source codes for different development platform. There are over 25 Silverlight samples inside which covered most of the basic techniques you probably don’t wanna miss.
Nov
Animated Dotted Text Outlines
An interesting animation effect created by Charles Petzold. He attempted to convert the outline of a text into dotted lines and applied a simple animation.
Nov
Embed rich font in title
Sistr, which stand for SIFR (Shaun Inman Flash Replacement) for Microsoft Silverlight, is a rich font replacement technology without having to create multiple jpegs or other files.
All you have to do is just to embed the js files and create your rich font title with some simple js.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.sistr.js"></script>
$(document).ready(function() {
$("h1").sistr({
font: "Arial",
size: 22,
color: "#FFCC00"
});
});
Nov
Countdown Badge
Josh Holmes created a very nice countdown badge control in which you are able to specific the target end date in the init parameters.
Nov
Leaving some space for HTML header
Silverlight works well by getting all the space of your browser. However, sometimes, you may want to leave some space (let say 60px) for your header in HTML format.
Here is any solution using JavaScript to allocate space for the Silverlight dynamically.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<style type="text/css">
html, body { height: 100%; overflow: auto; }
body { padding: 0; margin: 0; overflow:hidden; }
#header{ height: 60px; }
#silverlightControlHost { height: 100%; text-align:center; }
</style>
<script type="text/javascript" src="Silverlight.js"></script>
<script type="text/javascript">
var headerHeight = 60;
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}else{
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function updateSilverlightSize(){
var windowHeight = getWindowHeight();
document.getElementById('form1').style.height = (windowHeight - headerHeight) + "px";
document.getElementById('silverlightControlHost').style.height = (windowHeight - headerHeight) + "px";
}
</script>
</head>
<body onload="updateSilverlightSize();" onResize="updateSilverlightSize();">
<div id="header">You header</div>
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="silverlight.xap"/>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
</div>
</form>
</body>
</html>
Nov
Magnifying glass effect
Jeff Prosise shared a reusable Magnifying Glass effect behavior. Click on the screen and you are able to magnify your view.
Nov
Creating random globules
Charles Petzold demonstrated the use of WriteableBitmap in drawing random globules (with random color) on the stage.










