Archive for November, 2006

Kaxaml 0.2 (Alpha) Now Available (UPDATED)

Tuesday, November 28th, 2006

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

Not sure how you’re Thanksgiving was, but mine was great.  I had some extra hours to finally finish up Kaxaml 0.2.  This is a pretty big update for a “dot” release which, in addition to a handful bug fixes, includes some sweet new features.  You can download an MSI here. Here’s a rundown of the changes:

  1. Auto tag completion
    This might be the next best thing after intellisense (which Kaxaml is still sadly lacking).  It really does mean some serious typing savings.
  2. Insert spaces instead of tab
    No more crazy tabs in your XAML.  Plus, along with this comes my best attempt to put the cursor in the right place when you hit enter.  You can also indent (or unindent) multiple lines.
  3. Less crashing
    I’m trying to be a little smarter with unhandled exceptions now.  I used to catch parse errors, but not runtime errors.  Now, if you’re XAML throws at runtime I’ll try to kill the prased XAML object before it kills Kaxaml.
  4. Other bug fixes and minor features
    I’ve also fixed a bunch of little things that crop up during my day-to-day use, including some issues with “Save As…,” and Replace now works with empty strings, some refactoring, etc.

A lot of people have asked about intellisense and syntax coloring.  Inteillisense could happen someday.  I’m not saying it will, just that it’s not beyond my aspirations or technical abilities.  Syntax coloring, on the other hand, is much harder.  Kaxaml uses a regular old <TextBox /> for the text editor and it simply doesn’t support more than one color.  My options would be to either use a <RichTextBox /> or create my own.  RichTextBox is really slow.  Seriously, you don’t want it in Kaxaml.  Don’t get me wrong, it has its place, but Kaxaml is not one of them.  Writing my own TextBox is beyond my aspirations.

In the meantime, I hope you enjoy Kaxaml and get a lot of use out of it.  If you find bugs (and know it really is a bug), please let tell me about it.  I know there are more than I’ve heard about.  Also, the nuances of the editor behaviors I added still need some tweaking and I know it. 

Also, if you want to start writing a plugin, ping me and I can get you started.  If you’re plugin rocks, I’m happy to host it on my side or link to you.  Plugins are super easy to write.  I know I owe you some more documentation about that.  It’s about halfway done and even has screenshots.

Oh, and this version was compiled for .NET 3.0 RTM.  Woohoo!

Clever Rendering Technique for Custom Controls

Thursday, November 23rd, 2006

Karsten just outlined a very clever trick for rendering outside of OnRender and outside of CompositionTarget.Rendering.  It’s really clever and worth a read.

Incidentally, it’s highly unlikely that anyone is subscribed to my blog and not to Karsten’s, so sorry for the repeat.  Karsten definitely deserved props for unearthing this one though.  It’s a really handy idea.

Kuler

Wednesday, November 22nd, 2006

I’m a bit of a color nut, and I was just blown away by Kuler.  It’s an online, community driven color palette creationg and sharing app.  I know, that’s a lot of verbage.  It’s really cool though and could be really inspiring if you’re looking for colors. 

It also feature some pretty sweet design of its own.  My favorite part is the ginormous color swatches.  That being said, it can take a while to figure out how to create palettes of your own.  It’s worth it though.  Once you get the hang of it, it’s great because of their support for some of the classic color theory constructs (triad, complementary, etc.).  Great job Adobe!

They also included a pointer to this great color theory overview.  This is a really good read, especially if color is not intuitive to you–you know who you are.

Flash to XAML Awesomeness

Wednesday, November 22nd, 2006

XAML just got a serious jumpstart into cool.  In case you haven’t seen this elsewhere, Mike Swanson has just posted a Flash to XAML converter.  This is plain old rad/awesome/neato (depends on when you went to high school).  Defitely add it to your arsenal.

.NET 3.0 Has Shipped!

Tuesday, November 7th, 2006

The title was going to be that .NET 3.0 has left the building, but the connotation didn’t seem right because it didn’t leave, it arrived!  That’s right, .NET 3.0 is available in its final V1 form with all of its bug fixed and performance optimized goodness.  This is a great day. Congratulations team!  Get it here.

Comments

Saturday, November 4th, 2006

I just approved 10 comments.  Some were over a week old.  Unfortunately, my overly aggressive spam filter is misreading some of you.  Sorry for the delay on approving those and thanks for the comments.  I’ve tried to adjust the filter so I miss fewer next time.

Forcing a Particular Theme in a WPF App

Saturday, November 4th, 2006

From your many comments, it appears that the Zune theme leaves WPF apps defaulting to the Classic theme for default control styles.  This is as designed, but admittedly kind of a bummer.  Luna Silver would probably be a closer match or even the blue variant of Royale.

A couple of people asked if they can get WPF to load a different theme when Zune is active.  There isn’t a way to map this kind of indirection where one theme behaves like another one for all apps.  There are a couple of opportunities to know about though.

First, it is possible to force your app to always use a particular theme.  You do this by loading the resources for that theme at the root of your app.  When you do this, resource lookups which would normally make it all the way to the system theme only make it to root of the app where they pick up the resources you’ve specified. 

Here’s the syntax for forcing the Aero theme in a Window:

<Window
  x:Class=”TestProject.Window1″
  xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
  xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”>
 
<Window.Resources>
   
<ResourceDictionary
    Source=”/presentationframework.aero;component/themes/aero.normalcolor.xaml” />
  </Window.Resources>
</Window>

You need to have a reference to PresentationFramework.Aero.dll in order for this to work.  To try this out, create a new project and make sure to add that assembly to your project.

The second opportunity to be aware of is your chance to respond to the Zune theme when creating a custom control.  When you create a new control in VS by adding a “Custom Control (WPF)” to your project, VS generates a file called generic.xaml.  This is the file you use to create the default style for your control.  That file is called generic.xaml because it theme independent, i.e., it’s generic.  You can, however, add other resource dictionaries to that same directory to that are theme aware.  The naming scheme is [ThemeName].[ColorVariant] (thus, “aero.normalcolor” in the code above).  If you added a resource dictionary called “Luna.Metallic” to your project, we would would only load it when the Silver variant of Luna was the active theme on the machine.

So, presumably you could add something like Zune.NormalColor to your themes directory and your control would become Zune aware.  “Zune.NormalColor” is just my best guess as to the right naming convention.  Let me know if it works.

Royale Noir is now Official (and Called the Zune Theme)

Friday, November 3rd, 2006

Let’s start at the beginning.  “Royale” is the name of the theme that ships on Windows Media Center Edition (and it was also called Electric Blue or something along those lines on the Tablet release of XP).  Royale was blue and, in fact, looked a lot like the blue version of the Luna theme, but shinier (and prettier, but if it’s shiny, doesn’t that go with out saying?).

Well, when the talented folks at MSX were creating Royale, they also created a rogue version of the theme called Royale Noir.  Somehow it got signed and then unofficially distributed internally.  It was really cool.  It actually made XP look really great and it was common for people to think I was running Vista when they saw my machine with Royale Noir.

In fact, this became a bit of a problem.  I would purposely turn Royale Noir off if I was going to be showing my screen in public (at conferences, etc.) to avoid questions about the rogue theme.  I forgot a lot, though, a lot of you saw it and asked about.

So the good news: first, Royale Noir actually leaked a week or so ago.  You can get the leaked version here.  I wish this had happened a year ago.  It’s kind of crummy timing for MS, really, because XP now looks much cooler and right on the eve of Vista’s launch.  It’s great for XP users though.

Now for the twist.  Today, Nathan sent me a link to this.  It’s a refactored version of the Royale Noir theme that they are tying to the Zune.  Interesting.  Unfortunately, I can’t try this out because I don’t have a machine that boots to XP these days.  That’s right, I’m a serious self hoster (even on my MacBook!).  Word is, though, that it’s cleaned up, a little grayer and has an orange start button.  In case you missed the earlier link, get it here.

Incidentally, WPF does support Royale.  By that, I mean that we created a vector version of each of the default control styles for Royale.  But not Royale Noir.  Normally in this situation WPF would fall back to the classic theme for all the default controls.  I think that Royale Noir must have been a modified Luna Silver, though, because for some reason (which I never investigated), that’s what I seemed to get when Royale Noir was running on my machine.  If someone tries out the Zune theme with WPF, let me know what the default controls do.

Lester Lobo’s XamlPadX

Wednesday, November 1st, 2006

Lester just posted a private update to XamlPad (the very one that ships with the Widnows SDK) that gives it some very cool new functionality.  Some of this is the standard stuff that you would expect: Kaxaml and notepad style stuff like Find / Replace / Goto.  My favorite feature, howver, is a simple command interpreter that lets you write simple code to interact with objects in your tree on the fly.