Apr
15
In part 1 we covered setting up a very basic video player. In part 2 we will add
Scrubbing the video
wiring up volume,
and muting.
In future versions I will show how to display a buffer message, skin the controls, and how to work with media that’s not embedded in the xap.
Scrubbing
Add a MouseLeftButtonDown and MouseLeftButtonUp events [...]
Apr
02
Creating a video player in Silverlight is pretty simple. The MediaElement does all the heavy lifting, all you need to do is wire up a UI and you have a basic Video player. Here is a tutorial on how to create a simple video player from scratch using Silverlight 2.
Create a Silverlight application
Add [...]
Mar
31
My first code camp is over and done with. I got a chance to meet a lot of great people who are as interested and enthusiastic about Silverlight as I am. As promised here are the presentation and the code from my presentation on Saturday.
A couple notes: the presentation is saved as a [...]
Mar
25
Today I recieved an e-mail to The Best Tools for Visualization. For the past five years I have worked in a world where there is really only one way to display data, THE GRID. To be exact, the .NET DataGrid. This control alone has employed many developers and has allowed them to make a living [...]
Mar
19
A common mistake in Silverlight is for people to use the Canvas.Left and Canvas.Top property when positioning elements. In Silverlight 2, there is a push towards a relative positioning model. This makes the Margin, HorizontalAlignment, and VerticalAlignment very important (for all you CSS people the Margin starts on the Left and goes clockwise). So, how [...]
Mar
16
In Silverlight, there are two ways to set the source for an image.
image.SetValue(Image.SourceProperty,value);
image.Source = new BitmapImage(new Uri(value, UriKind.Absolute));
For the second option you will need to include the following namespace: using System.Windows.Media.Imaging;.
Mar
14
Just added Animations for Width and Height. Check out the code and the example. For more information here is the initial post. I will add more documentation after getting a few more animations in the engine.
Known issues:
After the animation of Width, the width property doesn’t get set. Same with Height.
Mar
14
It is possible to reuse a storyboard. Make sure to stop the storyboard before you set a new target property. Thanks Tom for pointing this out.
XAML
<Canvas x:Name=”LayoutRoot” Background=”White”>
<Button Height=”20″ Width=”120″ Canvas.Left=”0″ Canvas.Top=”0″ Content=”Button” x:Name=”btnTest”/>
<Rectangle x:Name=”Fred” Height=”30″ Width=”30″ Fill=”Aquamarine” Canvas.Top=”50″/>
<Rectangle x:Name=”Wilma” Height=”30″ [...]
Mar
14
In a previous post about how to create animations dynamically, I showed how to add StoryBoards from C#. I have extracted this logic into a class called SLAnimator. This allows you to do an animation from one line code, and a nice thing about this approach is it still uses the built in [...]
Mar
12
Here is how to consume a JSON object in Silverlight 2.
Start with a JSON object:
var Person = {
“firstName”: “John”,
“lastName”: “Smith”,
“address”: {
“streetAddress”: “21 2nd Street”,
“city”: “New York”,
“state”: “NY”,
“postalCode”: 10021
}
}
Create an entry point into Silverlight. You will need to add namespace System.Windows.Browser.
Next add C# classes to mirror the JSON object. It’s important to make sure [...]