Friday, August 24, 2007
a week with WPF

Although WPF has been officially available since the release of Vista (or months before), I would guess that it is just beginning to be seriously experimented with using Visual Studio 2008 Beta 2. Intellisense makes writing XAML easier.

There are so many new concepts such as attached properties, dependency properties, routed events, templates and styles that before now, seemed like individually interesting concepts but I didn't see how they all fit into a big picture. I'm starting to get it.

And with WPF the underlying language of Silverlight, needing to know WPF's moving pieces and higher-level concepts will gain momentum in the months leading up to February 28, 2008 -- when a slew of Microsoft tools seem to be converging on for release.

I believe WPF developers will benefit from understanding a few basic design principles. Some developers wear almost a badge of honor that they don't know how to do any graphic design stuff. I understand. If I try to draw something, you would be hard-pressed to know whether it was my drawing or a third grader's.

I marvel to see someone take piece of paper and pencil and draw a realistic looking face or tree or horse (some girls were really good at this). Here's an example of a YouTube video showing how to draw eyes.

I can see why people a few thousand years ago thought people who could draw on stone walls representations of animals with just burnt wood sticks left after a communal fire were uniquely gifted (in the sense that a gift comes from a giver).

WPF provides different types of panel controls where things can be arranged in patterns. Panels can be arranged together or nested within a top level design layout (panel). With gradients and margins and transparency, I'm sure the number of different UIs is infinite. But a few techniques, repeatable steps, patterns if you will, make designing an attractive and functional user interface very doable.

Just as we look on graphic design as inspired and magical (dependent on an inborn artistic gift that is either there or not), I bet many artistic folks are amazed by someone able to create a working Windows application. They don't know there are a few simple things to learn, a few techniques, a few conventions to follow and voila, you can create a program that does something interesting. You set out with a set of tools and an idea of how to proceed, and you build the pieces that work together to make interactive software.

Same thing with graphic design. It's helpful to watch a series of pictures that show how a design starts with a simple idea, and gets progressively more intricate as layers (colors, textures, fonts, shading) are added. Often, in programs such as Adobe Illustrator, these are literally on different layers that might be combined with various transparency levels or special effects such as using a gradient on one layer to reveal with graduated transparency objects on the layer underneath it.

In a future post, I will show some examples of design principles that map to WPF functionality. In the meanwhile, I'll keep learning WPF so that the map will lead to interesting places.
Friday, August 17, 2007
Day One with Blend

I expect this to be a 1000 mile journey on foot. I installed Expression Blend yesterday as well as the extensions for Visual Studio 2005.

I've been reading up on WPF, watching free video training movies from Lynda.com on Blend, and viewing video training on WPF, Expression Blend at totaltraining.com. I just attended Wintellect's 3-day Devscovery training in Redmond to see some sessions on WPF and Silverlight 1.1.

In a perfect world, Expression Blend would be the perfect accompaniment to Visual Studio. You can open the same project in both Blend and Visual Studio and you should in order to use Blend. Blend has no code-behind you can work in, and its xaml editor lacks Intellisense, but it has a terrific interactive view of the page or window.

Its properties panel is far richer than Visual Studio's. It has a list of all the properties one can apply to the selected item(s) in collapsible and expandable categories that can be searched effectively. This video shows the properties panel in Blend:

Blend Properties Panel video (4:44)

You click the lightning bolt at the top-right of the properties panel for a list of all events the selected item supports. You can type in an event handler for any event, and if Visual Studio is open, the event handler skeleton is placed in your code.

Total Training offers a bit more technical video training about WPF and Blend. The guys doing the training were or are on the WPF or Expression team. The Blend training even walks through doing a simple Value Converter (DateTime to String) in code.

The WPF videos were helpful though necessarily superficial. It's fun to watch how to create a menu, but I had just read a chapter about menus that described how real applications use commands so that the same action could be done from a toolbar button for example.

You can sign up for a free guest account at TotalTraining.com and watch the first 20 minutes of any series over two days. Microsoft posts some helpful free Blend training videos from Total Training.

As a first step in the water, I did benefit from the video training. For a gesture-intensive application such as Blend, where much functionality is accessible by clicking chevrons or little rectangular dots (to set data binding for a property of a control), it's helpful to watch someone use the application and narrate what they are doing.

In Blend, animation is done with a visual timeline, as in Flash. The beauty of a visual environment is you can have something in a storyboard at time 0, then move the play head (or whatever they call it) to some seconds later, then scale, move, change the color or transparency or rotation of that thing (setting keyframes at that time and at time 0) and Blend will do the in-between animation to get to the desired state at that future time. I know it can be done more concisely with XAML, but watching and tweaking is how a lot of us like to work.

You get identical results when you press F5 in either environment to run the project, but if there's any exception or runtime error it's best to launch it from Visual Studio with breakpoints and everything because Blend often displays a message that it encountered an error and has to close (though it just closes that file, not the Blend application itself).

Since a lot of WPF seems to be wiring things up (to resources and stuff), Blend can get out of kilter pretty easily when things aren't wired up correctly.

Again, if life were perfect, Expression Blend could be the perfect designer for the code-intensive Visual Studio, but the communication between the two is not always seamless. When you make a change in one environment, and return to the other, it prompts you whether to update the project because of the external changes. Often it seems you must build the project, not just save all files, in order for the other environment to be aware of all the changes.

I'll post more about Blend as a design tool if I have more to say that others might find interesting. I will also do a few posts about graphic design principles I've picked up that should be useful for preparing WPF and Silverlight graphic-intensive applications.
Thursday, August 02, 2007
One bird, one stone

I wanted a device to play videos downloaded from webcasts or sessions from MIX07 or TechEd that I could watch without the inconvenience of sitting watching my computer monitor or even finding a comfortable position to watch these videos on a laptop.

The Archos 704 has a nice-sized screen (7") and built-in speakers and costs about $480.

I wanted to watch some presentations about Silverlight and WPF and .NET 3.5 and thought it would be worth it for the convenience. I had some video training on Expression Blend/Design/Media Encoder downloaded from TotalTraining (more on this later).

After a little initial awkwardness using the stylus on the touchscreen (it helps to drag slightly when you tap on the screen), the device delivers what I had hoped for. They say that you can transfer files via USB, but it didn't turn out to be as simple as plugging in a USB key and transferring the files.

It pretty much has to use Windows Media Player to sync content because it has to do some conversion (either quickly or slowly depending on the source file's format) with a USB cable from your desktop or laptop to the device.

The video quality is pretty good although it does lose the extreme top or left side of some videos.

You can supposedly connect it to a TV with an optional Archos digital video recorder docking station and also stream video to the device wirelessly from your PC and supposedly use the built-in Opera web browser but comments from owners on Amazon are mixed at best.

My favorite feature was one I discovered by accident while browsing for information about the device. It has a little built-in kickstand that I use to prop up the device so I don't have to hold it while watching a video.

It also plays audio and displays pictures, but as I said, I bought it to do one thing only, and it handles that bird pretty darn well.

Here's an audio review of the Archos 704 but it's much the same as what I just described.
Words about people and things and ideas that you might find useful, interesting and enjoyable.

December 2003 / July 2005 / August 2005 / September 2005 / October 2005 / November 2005 / March 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / July 2007 / August 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / April 2008 / May 2008 / June 2008 / July 2008 / August 2008 / September 2008 / October 2008 / November 2008 / December 2008 / February 2009 / March 2009 / May 2009 / July 2009 / August 2009 / September 2009 / October 2009 / November 2009 / December 2009 / January 2010 / February 2010 / March 2010 / April 2010 / May 2010 / December 2010 / September 2011 /


Paste this into in your newsreader URL and choose "Subscribe":

Powered by Blogger