Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

Monthly Archives: March 2009

  • Silverlight Tip : Nest Another Grid Inside LayoutRoot for Flexibility

    This is something I’ve been doing since we first got LayoutRoot, and it has saved me aggravation a number of times. This works in Silverlight 2 and Silverlight 3 (the drop shadow effect in the example below only works in Silverlight 2). Simply put: I never set column definitions, margins or anything else related to layout directly on layout root. Instead, I nest another grid inside it and work...

  • Silverlight 3 Quick Tip : Lambda Expressions for Async Web Service Calls

    (this should work in SL2 as well) All network calls in Silverlight are asynchronous. The proliferation of event handling functions this can cause just makes for really cluttered code. Using lambda expressions seems to make my code a bit cleaner. (You can also use regular anonymous delegates, but the lambdas involve less typing) public void LoadPolicyDetail() { IvcDataServiceClient clien...

  • Some of the Shows I did at or around MIX – Hanselminutes, Continuum

    At and around MIX I managed to get into a couple shows to talk about my work in Silverlight 3. Hanselminutes Podcast 155 Scott and I sat down in a side room at mix09 and talked about the Silverlight 3 C64 emulator for a bit. And yes, 1mhz is 1 million times a second :) Scott Hanselman’s Weekly Source Code Scott pulls out some of the interesting bits of code from the C64 emulator and blogs a...

  • Creating Sound using MediaStreamSource in Silverlight 3 Beta

    Creating sound from raw bits is, believe it or not, slightly more involved than creating video from raw bits in Silverlight 3.Getting samples to Silverlight is an interesting task. Your code will respond to Silverlight’s request for a sample with a buffer of samples of a size you determine. Rather than a push model, like generating video, it is a pull model.Let’s start with the thin...

  • Using Blur to make Dialogs Pop in Silverlight 3

    When an application needs to display a dialog, there needs to be something to make the user immediately focus on that dialog, even when there are lots of other elements on the screen Most AJAX applications dim the screen behind a dialog by using a semi-transparent overlay. That certainly works well, but another effect to consider is a blur effect. Here’s the dim effect And here’s what a b...

  • My MIX09 Silverlight 3 ShowOff Video – Commodore 64 Emulator

    At this year’s MIX, for the first time, I submitted a ShowOff video. The topic was my Silverlight 3 C64 emulator. Given the nature of the topic, I couldn’t release the video until after the Silverlight 3 announcements. Here’s a small version of the showoff video. I captured the video using Camtasia (great software for capturing desktop video) and then edited it using Adobe Premiere Pro CS3. Th...

  • Silverlight 3 – Perspective 3d Transforms – PlaneProjection

    One of the most commonly requested features for Silverlight is some sort of 3d support. Within that, what many folks have expressed real interest in is the ability to do a perspective / non-affine transform of objects in space. Well, the Silverlight team delivered on that one for sure. Not only do we have the perspective transform (which could have been accomplished using shaders or the new bit...

  • Silverlight 3 – The Bitmap API / WriteableBitmap

    Silverlight 3 introduces the new Bitmap API useful for accomplishing three primary goals:Creation of a bitmap completely from scratch, pixel-by-pixelClient-side manipulation of an image loaded from your server or the local machineRendering of a portion of the visual tree to bitmap to perform screen-shot like functionality (or improve performance by pre-rendering and caching elements in certain ...

  • Silverlight 3 – BasedOn Styles

    Silverlight 3 now includes Based-on styles for cascading/inheriting styles. You’ll find this extremely useful when you need to create, say, several different buttons that share the same control template and several style properties, but change a minor detail like the background and foreground color. More generically, you can also use this to standardize fonts and colors throughout an appl...

  • Silverlight 3 – Taking Silverlight Out of the Browser

    One of the long-anticipated new features of Silverlight is the ability to take applications out of browser, online or offline.in Silverlight 3, it couldn’t be easier. Simply crack open the AppManifest.xml and uncomment the markup that allows for taking your app offline.<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://s...

  • Silverlight 3 – UI Element to Element Binding

    Silverlight 3 now allows UI elements to bind to each other’s properties. This is something WPF folks are pretty used to, but is new to the Silverlight world.Element Binding is very simple to use. As of this writing, there are some restrictions as to what you can bind to (for example, Transforms were not supported at this time), but this will save a ton of the glue/proxy code many of us ha...

  • Silverlight 3 – Creating Video from Raw Bits using a MediaStreamSource

    There are a number of ways to get pixels on the screen in Silverlight 3. One you may not have considered, especially with the new Bitmap API being an otherwise obvious choice, is the newly enhanced MediaStreamSource API The MediaStreamSource API was available in Silverlight 2, but it required you to transcode into a supported format. The new version of the API lets you create raw vide...

  • Silverlight 3 – Drop Shadows and Glows with Pixel Shaders

    Among the many enhancements in Silverlight 3 is the addition of Pixel Shaders. One of the shaders that is likely to be used most is the simple drop shadow. Like all Silverlight Pixel Shaders, the drop shadow has some little things you need to be aware of before you go and apply it to your controls.First, if you’re going to be animating the thing you’re applying the shader to, do som...

  • Announcing Silverlight 3! SL3 Post Index

    For those of you watching the agenda for MIX09, the announcement of Silverlight 3 probably didn’t come as a huge surprise. However, I bet hardly anyone expected the enormous number of new features that have been announced for Silverlight 3. Here are just a few of the new features along with links to my posts covering them:Core Application Platform FeaturesOffline and Out of Browser Suppor...

  • What I Use for Silverlight Development

    Three makes it a meme, right? :) Shawn and John recently posted about their Silverlight toolkit, so I thought I’d do the same. These are the tools and products I use on a regular basis when working in SL. There are others that pop up now and again, but I figured I’d only list the things I really rely on daily. I try to keep my working set fairly small so I can stay focused. Visual Studio 2...

  • More Uses for Value Converters and Extension Methods in Silverlight Binding

    I’m working on a super quick Silverlight 2 application for a restaurant kiosk. We’re using EF and Astoria / ADO.NET Data Services as our data provider, and to structure the client I’m using an implementation of MVVM based on Shawn Wildermuth’s great MSDN article showing how to implement simple MVVM using Silverlight 2. (the article is great in that it doesn’t go nuts trying to solve the command...

  • Flash / ActionScript Guitar Synthesizer and Andre’s Amazing Lab

    I’ve been playing around with sound synthesis lately and have come up with results that sound halfway decent (as an analog/subtractive soft-synth), but this example just completely schools me. Amazing sound. Keep in mind you could implement this in anything with a sound API, as it’s the algorithm and his realization/implementation of that that are important. Andre Michelle’s Guitar Synthesizer...

  • Are you going to MIX09?

    MIX09 looks to be as exciting as ever. I’ve been going to MIX since the first event, and love the people, the sessions and the venue. The lineup of sessions this year gives you a pretty good idea of what to expect at Microsoft’s premier web technology and UX conference.The PDC and MIX are my two favorite conferences; and they are completely different. If you are even remotely into w...