Remembering XAML's beginnings to help move forward with WPF & Silverlight
|
Earlier this week at the Vermont.NET User Group, local developer Zac Morris who is CTO of the Vermont based WattMetrics, did a presentation on XAML. The title of the presentation was "Don't Fear the XAML: How How Silverlight and WPF development can make you a better developer." Even though I've been using Silverlight since Silverlight 1.0 came out, I learned a lot from this presentation which was aimed at people without a lot of XAML experience. The reason is that while showing how to put XAML together, Zac also talked a lot about concepts and fundamentals. I spent a lot of time figuring out how to accomplish what I needed in WPF and Silverlight and this foundational information had slipped away from me at some point. The most important reminder from Zac was about the dynamic nature of XAML. It's not there to make your life harder, but easier. If you compare coding raw XAML to dragging and dropping controls onto a Windows Form, it may feel harder. But that's not comparing apples to apples. You can describe almost anything you need to about a control, even its data binding and event handlers, using this dynamic language. <DataGrid Height="324" HorizontalAlignment="Left" Margin="27,40,0,0" The actual .NET code that creates the class objects and performs the data binding is generated on the fly at runtime. And you can drag and drop XAML controls onto a WPF or Silverlight surface. The designer experience around this in VS2010 has improved. And then for much more control there's always Expression Blend. This reduced the amount of code in your application to business logic and data access code. It's not just this change though. The XAML allows you to embed controls within each other. There's plenty written about that since it's been around for a while. Another really important thing that Zac reinforced for me is the importance of creating Resources in your XAML that can be reused. Not only does it provide you with reusable code, but if a particular resource (whether it performs formatting or databinding) is only compiled once. Therefore if it's reused, you have a performance benefit at runtime. I never get to spend as much time as I want with WPF or Silverlight these days and when I do, I'm focused on the databinding and not working towards making XAML second nature to me, but attending this session was a great eye opener. To get started with Silverlight, check out the official Silverlight web site. For WPF, check out Microsoft's WindowsClient.NET website. |

