Monday, January 22, 2007

WPF/E - A basic WPF/E User Control

UPDATE - 05.05.2007 - The content of this post is no longer valid with the 1.0 beta release of Silverlight. The updated post and source code can be found here.

Recently, I wanted to learn about WPF/E so I created an ASP.NET User Control that takes the images from a specified directory and rotates through them and displays their reflection. I will admit, this posting is a bit light on pure information, however, I still wanted to share what I learned and the code I wrote. If you have any questions, please post a comment and I will be glad to answer them. (you can get the source code here):

I am not saying this is the best how-to on this type of thing, in fact, there are several improvements that can be made to the implementation. Rather, I created this as a proof-of-concept for myself, so I thought I would share what I learned along the way.
  • I was pretty impressed with the ease in using this technology. If you are familiar with JavaScript, you are going to find it easy to work with WPF/E. A long time ago, I learned ActionScript. It's mediocre, but personally, I would rather work with a widely used language such as JavaScript when developing. I'm very thankful the WPF/E team decided to use JavaScript instead of trying to develop some other new scripting language.
  • I really appreciated the fact that because WPF/E is in open text platform (it uses xml and JavaScript), the installation requirements fall on the client side. This was great because my hosting service doesn't have .NET 3.0 components installed, yet I was still able to deploy this sample.
  • I actually used the Microsoft Expression Blend Beta 1 for the graphics implementation. I was extremely pleased to see that I had to make ZERO changes to the xaml in order to get it to work within WPF/E. Very slick.
  • I had some difficulty deploying the application because the .xaml MIME type was not registered correctly on the hosting server. I do not own the server so I could not see what had happened. Shawn Wildermuth pointed out that sometimes you can have success deploying an application by using the .xml extension in place of .xaml. This is useful if you are having difficulty in getting .xaml registered as a mime-type. This little tip allowed me to get the WPF/E control you are seeing above deployed.


I plan on presenting on WPF/E in the Louisville, KY and Indiana geographies over the next couple of months. So if you're in the area and interested in this technology, please view the user group websites for more information.

once again, the source code is here if you would like it.

P.S. I just made the cut-off for my one-a-week posting goal by 27 minutes :)

1 comment:

Mark said...

Thanks Chad.
I've been thinking about using the new Fx tools for a series of cartoons on an asp.net Christian Ministries site. ;-)