Life of a techno-guru
Saturday, April 21, 2007
  Programming Using the Windows Presentation Foundation
Well guys, sorry I haven't posted recently, but I've been learning some new tricks to stuff up my sleeve ;-)

One of the primary things I have been studying recently, is the Windows Presentation Foundation (WPF) component of the Microsoft .NET Framework version 3.0. WPF is an extremely powerful framework for building rich, interactive user interfaces both quickly and easily for Microsoft Windows systems. The separation of user interface design and procedural code is a very significant change between the .NET 2.0 and .NET 3.0 frameworks, however, I believe that it is for the better. The tools I have been using to learn about the Windows Presentation Foundation include the (very extensive) Windows SDK documentation, and a book I purchased from Amazon last week called Windows Presentation Foundation: Unleashed by Adam Nathan.

I figured that I would show you all (if anyone really reads my blog, I'd be surprised ;-) ) a screenshot of one proof-of-concept application that I put together really quick. It basically proves my earlier point of being able to build rich UIs without much effort at all. In fact, this entire example was built using XAML, and I wrote absolutely zero lines of procedural code. The purpose of this example was mostly to show the capabilities of embedding WPF controls inside of other WPF controls, to show how much you can do in WPF without procedural code, and also I wanted to show off the performance of WPF-based applications. I believe that Microsoft has done an excellent job of making the .NET 3.0 framework the most powerful and easy to use software development framework, and I can't say that I have any reservations about using it exclusively for any major application development.

This application is very simple. It has a Button control, and a couple labels, and two Slider controls. On the Button control, is a StackPanel that hosts a TreeView control and a MediaElement control. One Slider control controls the rotation of the Button, and the other controls the rotation of the MediaElement directly on top of the Button, independently. The Treeview control is host to a few MenuItems, and it also has a ContextMenu, that has a couple MenuItems, but one of those MenuItems contains yet another MediaElement control that's independent of the one on the Button. Yes, that's all kind of confusing, but just look at the screenshot and you'll see for yourself!

Edit: E-mail me for the XAML if you're curious to see how I did it. Hint: It's really, really easy ... I just think it's cool ;-)

Google Mail: pcgeek86

Edit2: Here's a link to the Binding Markup Extension I used to bind the output value from the Slider controls to the Angle property of the RotateTransform objects. This is mainly what kept me from having to use any C#
Comments: Post a Comment

<< Home
My life of learning various things about technology including network administration, development, and 3D design

Location: Chicago, Illinois, United States
January 2006 / February 2006 / March 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / August 2007 / December 2007 / January 2008 / March 2008 / April 2008 / June 2008 / July 2008 / September 2008 / December 2008 / January 2009 / February 2009 / March 2009 / May 2009 /

Powered by Blogger