What, No Design Mode Property?

Brian in Cider | 15 Comments July 3, 2006

If you’ve written controls for Windows Forms you may have encountered a property on the control called DesignMode. This property returns false when the control is running in an application and true when the control is running in a designer. I’ve always considered this property to be a necessary evil. On one hand, we did a lot of work in Windows Forms to allow you to separate your design time logic into a separate DLL from your runtime logic, so the property is unnecessary. On the other hand, it just isn’t always practical or possible to separate all design time logic out of your runtime DLL.

More...

User Interaction in Cider

Brian in Cider | 2 Comments April 16, 2006

The ways users have been able to interact with controls on the designer has steadily been evolving. With ActiveX controls in VB 6, users were simply presented with a rectangular region they could click and drag. Grab handles were provided entirely by the designer and were not customizable by the controls. The only mechanism control authors had were “verbs”, which were commands that appeared on the context menu for a control.

Windows Forms 1.0 slightly improved this by giving control authors a design time “paint” event that was called after their control painted. This event allowed a control author to draw additional design time UI on the surface of the control, but all user interaction with that UI had to be done by hand. Windows Forms 2.0 greatly improved this model with an object called the Behavior Service. The behavior service allowed a control designer to add a “behavior” onto a stack of behaviors. A behavior was a hook into all mouse, keyboard and menu command input and could also provide lightweight UI objects called “glyphs” that would float on top of the controls on the design surface. The behavior service enabled us to create some cool features in the Windows Forms designer like snap lines and smart tags.

More...

Cider's Extensibility Architecture

Brian in Cider | 0 Comments December 22, 2005

It's time for my second post on Cider's design time architecture. Last time I introduced the editing context and described how services and context items work. It's now time to talk about how we're going to do extensibility in Cider. Before I can do that I need to explain what I mean when I talk about an extensible design time architecture. Then, I need to give you a little background on how Windows Forms implements their extensibility, and finally I can start to describe how we do it in Cider and why we chose to do things differently.

Design Time Extensibility

In the good old days of ActiveX controls, designers weren't very extensible. The property window for VB 6, for example, was hard-wired through the magic of OLE Automation to know about exactly four data types: fonts, colors, enums and variants. The VB 6 designer treated all controls as opaque rectangles. As long as your custom control could fit into these four data types and be treated as a rectangle that could be placed and sized in X-Y coordinates, you were happy. The introduction of Windows Forms required that we re-think some of this. For example, the .NET Framework introduced many new data types. Having a property window that only understood a limited set of data types would have made learning the increased depth of Windows Forms much more difficult. Also, Windows Forms introduced concepts like pluggable control layouts, so assuming all controls fit a standard rectangular X-Y model would have been a big compromise.

More...

Introduction to the Cider Designer's Architecture

Brian in Cider | 9 Comments October 23, 2005

This is the first of a series of posts about the architecture of the Cider designer. Cider isn’t going to be shipping for a long time, so this isn’t information you can immediately put to use. Actually, I’m hoping that by publishing our plans very early like this I can get feedback about what you like and what you don’t like. That way I can get the stuff you don’t like out of the product before you see it. I’m going to roll this out by first describing to you how everything works, and then I’ll get into what the “everything” part is.

More...

Cider isn't a Random Code Name

Brian in Cider | 1 Comments October 7, 2005

I've begun reading Charles Petzold's blog and his post of an old English poem mentioning Avalon made me think back to our choice of the code name "Cider" for the Avalon designer we are producing. Where did Cider come from? It is surprising how much time you can spend coming up with a code name...

Cider relates to Avalon both geographically and metaphorically.

More...