Tim Sneath

Musings of a Client Platform Guy

December, 2006

  • Tim Sneath

    Building a Perfect WPF Developer Workstation

    • 48 Comments

    OK, so you've just decided that WPF is the strategic technology of choice for your next-generation application, and you've taken the opportunity to flatten and reinstall your developer workstation. What should you put on it to create the perfect WPF development environment? There are so many good tools, utilities and samples out there, that I thought I'd put together a little checklist that will hopefully help folk out. I'd love to hear your suggestions for anything that I've missed: I'll try to keep this updated over time.

    Base Environment

    Tools and Utilities

    • XamlPadX, Kaxaml and XamlCruncher: three enhanced alternatives to the XamlPad tool that ships in the SDK. Each have their strengths: XamlPadX has some nice add-ons and is based on the XamlPad codebase, Kaxaml is great for demos and has good tab / indent support and XamlCruncher has high-quality source code available.
    • Lutz Roeder's .NET Reflector: handy for browsing through class hierarchies;
    • Snoop: Peter Blois' tool for visually debugging WPF applications;
    • WPF Performance Tools: buried in the SDK but an essential part of the toolset for an application in the stabilization stages. Youll find it as %SdkTools%\WpfPerf.exe (make sure you run it as an administrator if you're using Windows Vista);
    • Flexible Application Template: this replacement project template from one of the app services PMs allows you to create a single application project that can flip between an XBAP (web browser project) or rich client application just with an adjustment to the project type;
    • ZAM 3D: Electric Rain's utility for quickly creating and animating 3D meshes.
    • XAML Converters: Utilities for converting 3DS, DXF, Blender, Fireworks, Lightwave, SWF, Maya and Illustrator files to XAML format.

    Building a Code Toolbox

    • 3D Tools for WPF: interactive 2D on 3D surfaces, wireframe lines, 3D mouse navigation;
    • Kevin's Bag-o-Tricks: a collection of controls that extend and enhance the intrinsic types ColorPicker, FolderPicker, NumericUpDown, RadioButtonList, date controls, animating tile panel and graph controls;
    • UI Automation Stress: stress testing for your application environment. (Add this code into a debug menu to make sure that you can't crash your application with spurious input.)

    Sample Applications

    I'm the kind of developer who likes lots of sample code available to me for copying concepts, ideas and techniques. Copy these to a \samples directory for quick access:

    Also unpack %SdkTools%\..\Samples\WPFSamples.zip to a \samples\sdk directory so you can easily browse through all the samples without needing to go through the SDK documentation interface.

    Now enable Windows Desktop Search (install WDS 3.0 here if you're running Windows XP) and configure it to index file contents of .xaml, .cs, .vb files as a bare minimum. Make sure it's set to index the entire \samples directory that you put the above samples into. Now you can quickly pull up every sample that shows the usage of (say) BitmapSource and ColorConvertedBitmap just by hitting Win+F and searching for those keywords.

    Support

    • The WPF MSDN Forum is frequented by both the product team and many other knowledgeable community members, and contains a great archive of questions previously asked (and answered);
    • The WPF MSDN Newsgroup provides a very similar service to the web forum but in the form of a USENET newsgroup. At the time of writing, the forum seems to have significantly more traffic, however.

    Tips and Tricks

    • Make sure that you integrate the Windows SDK documentation with the rest of the MSDN documentation on your system: run Start -> Windows SDK -> Visual Studio Registration -> Integrate Windows SDK with Visual Studio 2005 as an administrator for easy F1 integration from the code view.
    • I make liberal use of pinned shortcuts on my Start menu to make it easier to access some of these tools, particularly XamlPad, WpfPerf and other tools that are really hidden by default. If you're running Windows Vista, this tip will give you a quick shortcut to each of these items also.
    • Set the Windows Presentation Foundation Font Cache system service to Automatic (Delayed Start) if you are running Windows Vista, to reduce initial start-up time for WPF applications.
    • In Visual Studio, set the default font to Consolas - it's easier on the eyes than Courier New and was designed with code development in mind. Consolas is included with Windows Vista or Office 2007, or you can download it here.
    • From the Windows SDK documentation, the "New in Windows Vista" index filter is a great way to ensure that you don't get the WPF and Windows Forms APIs accidentally mixed up: I've come across a few developers who had accidentally started using types from both libraries together simply because they hadn't spotted the very subtle clues in the documentation that differentiate them.
  • Tim Sneath

    Visual Studio 2005 SP1 Compatible with WPF and WPF/E Templates

    • 0 Comments

    Just in case anyone was wondering, you're safe to install the service pack for Visual Studio 2005 on a machine that has the .NET Framework 3.0 Extensions and/or the "WPF/E" project templates. One thing to be aware of is that Visual Studio 2005 SP1 includes the web application project types which are required as a prerequisite for the "WPF/E" installation, and you're strongly encouraged to remove the add-in that I mentioned in step 5 of this post before installing SP1.

  • Tim Sneath

    WPF Unleashed - New Book from Sams Publishing

    • 12 Comments

    If you're looking to learn WPF from a book, there are an increasing range of good choices out on the bookshelves that are based on the shipping APIs.

    The latest book to be published is WPF Unleashed by Adam Nathan. If you've ever needed to do any coding to the Win32 API from a managed environment, chances are high that you've either got a well-thumbed copy of his book .NET and COM on your desk or you've found an API wrapper at his website pinvoke.net. Almost uniquely for a technical book, .NET and COM was so popular that there was a grass-roots developer campaign to resurrect it after it went out of print - for a while, it sold used for significantly over its list price on eBay, before the publisher ordered a new print run.

    So what's the new book like? While I haven't yet had the opportunity to read the final manuscript from cover to cover, I've seen a number of draft chapters and there's a lot to like here. Adam has a readable, human style that isn't as dense or exhaustive in its coverage of each topic as Charles' work, but provides some great practical insights in the many sidebars scattered throughout the book that will help you apply WPF concepts to your own projects. As one of the key developers on the 3D team, I'm looking forward to reading Daniel Lehenbauer's contributions on that topic, particularly since there's only sketchy printed coverage available thus far on that topic.

    For such a visual technology, SAMS have taken the smart choice of publishing the entire book in color, and that has a powerful impact on comprehension: being able to scan through code listings printed with the same color scheme as you'd see on-screen in Visual Studio makes it far easier to pick out the salient points. Of course, it's even more important for coverage of topics like styles or vector drawings, when color is everything. This book sets a new bar for visual polish, and I hope other publishers take note.

    The publishers have been generous enough to offer a sample chapter available for download from this blog; it covers a number of the major new concepts in WPF - dependency properties, routed events, visual trees. Remember - you saw it here first!

    Which of these three books should you buy? It's hard to make a categorical recommendation of just one title: they all have their strengths. If you're just starting out with WPF and are looking for a survey of the major elements and concepts, then Laurence's Apress book is a great introduction. If you're already developing with WPF, you'll find Charles' Microsoft Press book to be a treasure trove of elegant solutions, clever tricks and precise explanations. If you're looking for a good general purpose, approachable guide to the breadth of the WPF platform, then Adam's SAMS book is definitely worth a look.

     

  • Tim Sneath

    Microsoft Expression Launch Event

    • 11 Comments

    I'm presuming that almost everyone who follows this blog has at least one of the Expression design tools on their machine; Expression Blend (formeddrly known as "Sparkle" or Expression Interactive Designer) is an essential part of the arsenal for any WPF developer; Expression Design is a capable graphics tool that can output XAML in either WPF or "WPF/E" dialects; Expression Web is a very worthy web development product for creating standards-compliant markup, and lastly Expression Media combines digital asset management (image and media cataloging and workflow) with media encoding tools.

    We've just announced the coming out party in the United States for the tool suite, with events in San Francisco, Chicago and New York during the latter half of January. If you're in or nearby any of these cities, you can register to attend some designer-focused sessions, meet up with a bunch of us and even attend a cool cocktail party. Full details and event registration can be found at the website.

    If you're not conveniently placed for these sessions, remember that we have our inaugural WPF online chat taking place this Thursday at 12:30pm Pacific; details in the preceding post.

  • Tim Sneath

    WPF Technical Chat: Thursday December 21st

    • 9 Comments

    Following on from a couple of requests, I'm delighted to announce that we'll be hosting our first ever live online technical chat with the WPF team on the MSDN site next Thursday, December 21st, at 12:30pm Pacific Time (that's 3:30pm ET, 8:30pm GMT, 9:30pm CET). We'll have a collection of the WPF team on hand to answer your technical questions, hear your feedback on what we should be doing in our next release, share great tips and tricks for using WPF, and just generally connecting with one another.

    If you're interested, you can click on this ICS file to add the appointment to your calendar. And please feel free to RSVP in the comments section below so that we know to roll out the red carpet for you!

    Hope to see you there!

    [Update] Thanks to those who've pointed out my error - next Thursday is in fact the 21st, not the 20th. I've corrected the details above. Just testing!

Page 1 of 2 (10 items) 12