Apr 17 2008
Silverlight 2.0 - Hello World part 2…
In silverlight you can easily add images thru the XAML or the classes (ie: c#)
To add it thru the XAML all you have to write is this:
<img Source="Picture.jpg" x:Name="MyImage" VerticalAlignment="Bottom" />
Here is the whole code:
<usercontrol x:Class="SilverlightApplication1.Page"></usercontrol>xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"> <grid Background="White" x:Name="LayoutRoot"></grid> <img Source="Picture.jpg" x:Name="MyImage" VerticalAlignment="Bottom" /> <button Content="Hello World!!" Width="200" Height="50" Click="onButtonClick" Background="Aquamarine" x:Name="test"></button>
You can see a demo here: demo
Next I will explore a third party class TWEENER, that works very similar to the TWEENER class build for ActionScript.

Posts