Inveigled By Design

The art of persuasive design

Silverlight 4: Integrating With COM


One new feature introduced in the Silverlight 4 beta that caught my eye was the ability to communicate with a Silverlight app via COM. It definitely opens up some powerful ways to interact with the Windows desktop environment in Silverlight. I mocked up this quick demo just to see how it might work and hope it’s useful to someone else trying to figure out how to do this.

Here are the tools you need to get started:

The Silverlight 4 Beta Tools will give you the Silverlight 4 runtime, integrated project support in Visual Studio, and the Silverlight 4 SDK. Remember that these are beta tools, so I do not recommend installing them on a production developer machine just yet.

There’s more information on getting set up with Silverlight 4 here:
Silverlight 4 Beta Information

Get the Code:

Download the code here:
SilverlightComDemo.zip

(more…)

Unit-Testing WebClient Dependencies in Silverlight


If you are going to be interfacing with web services in Silverlight, there’s a good chance you’ll have classes that are dependent on System.Net.WebClient. Unfortunately, because of some of the security restrictions in Silverlight, you cannot mock or stub the System.Net.WebClient class. In addition, the constructor for DownloadStringAsyncCompleteEventArgs is internal, making it difficult to simulate the web client completing a call.

I started trying to test this completely within Silverlight by creating an interface and testable wrapper around the WebClient class. I ran into a dead end, though, when I tried to create the EventArgs classes. Silverlight will not let you create an instance of a class with an internal constructor via reflection because of the security restrictions.
(more…)

Learning Silverlight: Auto-run a Storyboard in Sketchflow


One thing I want to have in the project prototype I’m working on in Sketchflow is the ability to run a storyboard automatically when a form loads. This is a fairly straightforward process. I’ll demonstrate it using a progress bar whose value progresses from 0 to 100 after the screen loads. Click this link for a sneak peak at the functionality:

Auto Run a Storyboard Demo

Step 1: Create a Progress Bar on the Sketchflow Screen:

Open Blend and create a new Silverlight 3 Sketchflow Application. Display the SketchStyles assets by clicking on the Assets tab on the left column of the Blend window, expanding the Styles list, and choosing SketchStyles:
(more…)

Installing XAMPP on Windows 7

I just switched over to using Windows 7 with a full development setup including IIS 7 and Sql Server 2008 (including reporting services). I also use Apache to edit a local copy of my blog and websites. I decided to let apache run on the default port 80. In order to do this, I installed XAMPP Lite, which was pretty straightforward, but getting it running was not. Here’s what got it working for me:

Step 1: Download and install XAMPP:

Download and install one of the XAMPP exe files from here:
Apache Friends – XAMPP For Windows
(more…)

Setting SketchStyles in SketchFlow

When I first started up SketchFlow to create a prototype, by default all of the controls were styled using the standard controls styles rather than the sketch-like style I had seen in the SketchFlow demos. It wasn’t obvious to me how to use the sketch style and I didn’t find it easily, so here’s how to do it:

Create a new SketchFlow project:

You can create one for Silverlight or WPF:


(more…)

Creative Commons License
Content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 License
Copyright © 2009 Inveigled Software