Donald Burnett has an interesting piece call Poor, maligned, and misunderstood by many: WPF/E which I found to be an interesting read. He brings up two myths about WPF/E that (1) it doesn't support databinding and (2) it doesn't have any input controls. I think I've personally contributed to dispelling the first myth here and here but I haven't spent much time on the second one. I've spent a lot of time thinking about it and I've written about it in the WPF/E forums but haven't done anything beyond that.
Then today I read Martin Grayson's updated tutorial on creating glassy buttons in WPF.
I thought the buttons looked pretty cool and so I set out to create them in WPF/E. I decided to code them up as a server control instead of just writing plain old xaml. You can view the end result of my work here:
I wrote the code to create the server code once and now I just use an ASP.Net page to generate my Xaml. The ASPX page is very simple and looks like this:
<%@ Page Language="C#" CodeFile="Buttons.aspx.cs" Inherits="Buttons" %><%@ Register Assembly="Wpfe.Controls" Namespace="Wpfe.Controls" TagPrefix="cc1" %><Canvas xmlns='http://schemas.microsoft.com/client/2007'xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Width="800" Height="600"><cc1:GlassButton ID="GlassButton1" MouseLeftButtonDown="javascript:click" Left="200" Top="200" Width="179" Height="34" Text="My First Button" runat="server"/><cc1:GlassButton ID="GlassButton2" MouseLeftButtonDown="javascript:click" Left="200" Top="300" Width="179" Height="34" Text="My Second Button" runat="server"/><cc1:GlassButton ID="GlassButton3" MouseLeftButtonDown="javascript:click" Left="200" Top="400" Width="179" Height="34" Text="My Third Button" runat="server"/><Canvas.Background><ImageBrush ImageSource="Aero_grass.jpg" /></Canvas.Background></Canvas>
To create the button controls I simple followed Martin's tutorial using notepad and created the WPF/E xaml. Then I wrote a server control that output the Xaml and added properties to allow the output to be formatted the way I wanted. The link to the source is below if you're interested, but really this is just a proof of concept. I think there is so much more that could be done in this area and this is just scratching the surface.
What controls would you like to see? I'm thinking a basic button, textbox, dropdown, radio, and checkbox controls would be nice to have and probably not to difficult to create. I'm hoping to finish up Part 3 of my WPF/E data grids series using a WPF/E data grid server control. Anyone interested in starting a codeplex project?
Source Code Download