Archive for October, 2006

Custom Namespace URLs

Tuesday, October 31st, 2006

Pavan just a blogged a really handy trick for managing a large group of namespaces from XAML.  He explains how you can declare a URL for your custome namespaces using an attribute, just like the default WPF classes have (e.g. “http://schemas.microsoft.com/winfx/2006/xaml/presentation”).

Incidentally, I’m a new reader of Pavan’s blog and it’s definitely worth checking out.  Tons of great thinking there.

Kaxaml Screenshot

Thursday, October 26th, 2006

I’ve had a couple of requests for screenshots, so here you go (click to see the big version):

Kaxaml 0.1 Requires .NET 3.0 RC1

Thursday, October 26th, 2006

A few of people have had difficulties installing and/or running Kaxaml.  At least a couple of these issues have been related to mismatched versions of .NET 3.0 (a.k.a. WinFX),  or missing WinFX altogether.  So, just to be clear, WinFX is a requirement.  So make sure you have installed .NET 3.0 RC1 on your Windows XP machine or you are running either RC1 or RC2 of Windows Vista before attempting to use Kaxaml.  If you continue to have issues after meeting this requirement, please post a comment or send me email to let me know and we can track down the issue.

Kaxaml 0.1 (Alpha) (UPDATED)

Sunday, October 22nd, 2006

UPDATE: This is version of Kaxaml is no longer current. Get the latest at www.kaxaml.com.

Introducing Kaxaml, a “live view” XAML editor and the long ago promised upgrade to SplitView . It’s finally done-ish, and you can get it by downloading a .zip file here or downloading the .msi here. This version targets WPF RC1.

This is very much a “use at your own risk” alpha release. I was listening to a podcast of the Churchill Club this week and someone on the panel said that if you’re not embarassed by your first version of a product, then you’re taking too long to ship. Kaxaml isn’t embarrassing yet, but that’s only because my test team (me) hasn’t really done any testing. I really don’t know what kind of bugs you’re going find and that’s when it might get embarrassing. Please let me know what kind of problems you run into.

Nevertheless, it’s definitely a few steps beyond what SplitView offered. Here’s what Kaxaml brings to the table:

  • File operations (New, Open, Save, etc.)
  • Find / Replace / Goto Line
  • Snippets
  • An extensible Plugin Model (more details to come, but this means you can build and share your own plugins!)
  • A color picker (this first plugin)Â
  • Full-screen modeÂ
  • Configurable settings for: parsing timeout, backup, editor placement, editor font
  • A snazzy dual-chromatic UI

I’m sure I’ve left something out, and there is definitely more to come. The plugin model is the thing I’m most excited about. Anyone can write a plugin. It’s easy. All you need to do is create a WPF UserControl that compiles to a .dll and then set an attribute called “Plugin” on the class that you want Kaxaml to load as the plugin. The attribute is defined in an assembly that you will want to reference called KaxamlPluginHelper and has four parameters that describe the plugin. I’ll try to put a how-to document together and post it in the next week or so. In the meantime, let me know if you have any success writing a plugin.

I’ve started using Kaxaml pretty much exclusively for any scenario where I would have used XamlPad in the past. It’s great for quickly creating bits of UI that you want to insert into a larger project. The main advantage of Kaxaml over VS is that you can immediately see the results of what you’ve created without a compilation step. Please let me know if and how you use as well as any other feedback you have. Thanks.

"PART_ … "

Thursday, October 12th, 2006

If you’ve done any digging into WPF control templates, you’ve likely come across an element or two called “PART_[something].”  These guys are scattered throughout the default control styles and are also widely used in SimpleStyles.  You might be wondering what it means and what it does.

So, here’s the skinny: “PART_” is just a naming convention.  It means that the control expects an element with that name to exist in the template and will be looking for it.  Think of it as a way to flag that element as important and an indication that the name shouldn’t change. The control could be looking for that element for a variety of reasons.  A common example is to add an event handler. 

In fact, Any time the control needs to interact directly with a “part” of its template, the “official” best practice is to use the “PART_” naming convention.  The other part of that best practice, though, is that things should “fail gracefully” when that element isn’t available.  Obviously, some parts matter more than others and a missing part might mean missing functionality, but things shouldn’t blow up (exceptions, etc.). 

This is important for a number of reasons, but especially because it is common for elements to be missing while a template author is mid-authoring.  This is especially true in a tool like Expression Interactive Designer. 

The official manifesto on these kinds of best practices can be found here, although it looks like the updated version with the “PART_” convention hasn’t made its way into the SDK (that may have been my bad).

In the meantime, if you’re authoring templates this should help to clarify things a little.  I don’t think anyone has documented the complete list of “PART_” parts, but I believe they are all represented in SimpleStyles.  Also, if you’re building controls, it would be a great idea to follow this convention whenever possible.

Notstatic.com not Really All That Not Static

Tuesday, October 10th, 2006

Yeah things have been pretty static (dare I say stagnant) lately, but I’m back and happy to be writing again. 

The lapse is, in part, due to some big changes for me.  With WPF all but out the door, the team has been transitioning into V2 planning.  There are some exciting things on the horizon for WPF, but, for better or worse, I took this opportunity evaulate my career and found an incredible opportunity outside of Microsoft.

So, I’ve taken a job with IdentityMine.  It’s been awesome.  Working at Microsoft was amazing and moving on was a tough decision.  I loved the people I worked with and I loved the technology.  In fact, I may have loved the technology too much because that’s what drew me to IdentityMine.  I’ve really had a chance to pull out my inner design kung fu and create some neat stuff.  IdentityMine is a design/dev firm with a strong specialty in WPF.  This really is more in line with my passions these days, and it;s been an amazing place to do that.

Along those lines, we’ve really assembled an world-class team and word seems to be getting out because these days it seems like we nearly have more work than we can handle.  Because of that, we’re definitely looking for more great people.  It really is a fabulous company, so if you’re potentially interested please don’t hesitate to contact me

One last update: I’ve had lots of requests for an updated version of SplitView.  SplitView is a XamlPad-like tool that I’ve used in presentations from time to time.  It had some features that XamlPad has been conspicuously missing (like Find and Goto Line).  It didn’t, however, have many of the features that you would have come to expect from an editing tool like Save and Open.  Because of that, I really haven’t kept it up.  Instead, I’ve redirected my energy into a new tool called Kaxaml (read kuh-zamel).  IIt’s the best of SplitView meets the best of XamlPad meets the best of Notepad.  ‘ll have a beta up by the end of the week so stay tuned.