survey of silverlight markup 1

Posted by Karim on July 31, 2008

So I just read Robby’s fantastic and informative post discussing the state of 3d support in silverlight and I had one nitpick clarification I wanted to point out. Some context; in his post he discusses markup in silverlight within the “‘Real’ 3D Frameworks” part, stating

Unfortunately, Silverlight doesn’t yet have the parser extensibility required to make these APIs markup friendly. For now, at least, the 3D API may be compatible with WPF in code, but there’s not a good markup story.

This isn’t exactly true. Silverlight supports custom TypeConverters, which would allow the xaml parser to convert custom type markup to objects. This is just a case of Kit3D hasn’t yet ported those over, for things like Vector3D using a Vector3DConverter.

The xaml story for silverlight is pretty strong, over all. In addition to TypeConverters, you can use XmlnsDefinition in silverlight, so that you can map several namespaces to a single schema Uri providing a more natural usage of namespaces in your xaml. The only thing that silverlight is really lacking is MarkupExtensions, which incidentally I think will be added in a future release, based on the fact that the MS.Internal.IMarkupExtension interface exists in System.Windows.dll.

[Updated 8.5.2008]
Hey Robby, Turns out I was wrong about XmlnsDefinitions. Yes the attributes exist in silverlight 2, but the XamlParser does not respect them. As Mark has informed me, this is a feature that will be added after Silverlight 2 RTM. On the plus side, TypeConverters definitely work. :)

silverlight 2 beta 2 maintenance release 1

Posted by Karim on July 17, 2008

A maintenance update to silverlight 2 beta 2 was released via Windows Update today, bumping the runtime version number from 2.0.30523.6 to 2.0.30523.8.

From the KB Article:

This update improves stability, media streaming, and the auto-update component. This update also improves support for Mozilla Firefox 3.

I’m still hopeful that Silverlight 2 RTM will have a Trigger construct of some kind. But I’m convinced ElementName bindings, Data Template Selectors, and Markup Extensions won’t come until 2.5 or 3.

debugging design-time exceptions

Posted by Karim on July 13, 2008

I just found an excellent tip from Peter Blois on debugging exceptions in blend. Many, many people have experienced this with controls that work perfectly at runtime but throw in the designer, to the point where most designers/integrators will build out in a seperate, throw-away project and paste the result into the real thing.

Good post, Pete!

the blend addin class 6

Posted by Karim on July 11, 2008

I discovered, much to my surprise, that Blend 2 has the necessary infrastructure to support rudimentary custom extensions.  The extensions take the form of a class which implements the public interface Microsoft.Expression.Framework.AddIn.IAddIn.

Inline is a very simple HelloWorld sample.

AddInDescription("HelloWorld", AddInCategory.Tool)]
public class HelloWorld : IAddIn
{
    public void Initialize(IApplicationService 
      applicationService) {}

    public void StartupComplete()
    {
        // Show we were here
        System.Windows.MessageBox.Show("Hi");
    }

    public void ShuttingDown() {}

    IDisposable Members
}

AddIns are hooked on startup, specified as command line arguments:
path\to\blend.exe /addin:HelloWorld.dll

blend addin test

When initialized, an Application ServiceProvider object reference is passed, which contains accessors to all the major service provider objects of Blend.  Through this, it’s possible to add custom menus and dialogs, possibly even panels, to Blend.

I expect there are alot of limitations.  The most glaring is loading Addins only by specifying them as commandline arguments. Much of Blend is internal and/or sealed, including Nautilus (Blend’s code editor), Visual Studio abstractions for Projects, Solutions, and the Build system.  Enough remains open to allow for some customization of existing features, and certainly for new features.

menu and dialog inside blend

More discovery needs to be done.