Archive for the ‘WPF’ Category

When WPF was released over three years ago I was expecting it to become the dominant desktop technology by now. This has not been the case, which is lucky for me because it has taken until now for me to complete the original set of components I wanted to create for Krypton.

But I do think that given enough time it will gradually take over because of the extra power and flexibility it provides. Silverlight 3 now makes it possible to build desktop quality applications for the web which has the potential to really drive the adoption of XAML and WPF.

So to make sure I don’t completely miss the boat I need to start playing around with Silverlight/WPF and coming up with ideas for components. Given that Silverlight/WPF will be around for at least a decade it makes sense to create some controls or components that have a long potential lifetime of use. Write once and sell for a decade feels like a good business model. It also makes sense to start with components that can be used as building blocks for creating bigger and better components in the future.

The first result of my experimenting is an animating panel that this pluggable. This MetaPanel control is intended to solve two related problems. First is the problem of changing panel layouts. If you want to alter the layout of children between a WrapPanel to a StackPanel you need to create the StackPanel, move all the children across and then remove the old WrapPanel. Not difficult but a painful process.

The MetaPanel control instead has a pluggable layout algorithm so that you can switch the layout without having to create a new control. This is a much easier process to manage and also makes it easy for the developer to create custom pluggable layout algorithms for specialized scenarios.

The second problem is one of animation. As panel children are moved to new locations it would be nice to have some form of animation in order to give the user visual feedback. If you are moving all the children from one panel control to another this becomes very difficult to achieve. But as our children are always children of our single MetaPanel it becomes very easy. Whenever the layout is changed we animate the children to new positions. In fact the animation algorithm is also pluggable allowing maximum flexibility in specifying different animation requirements. With the layout and animation being pluggable you can see why I named it MetaPanel.

Use this MetaPanel TestPage link to see a simple Silverlight application that allows you to play around with the control. You should see something like the following…

Use the top row to add and remove child items.
Use the second row to change the layout algorithm.
Use the third row to alter layout specific values.
Use the last row to alter animation settings.