This is the state of my mind at this precise moment. Thinking of code as well as trying to think of something else. Its Friday night, I’ve had my dinner and am really tired to do any more work. Thought of updating my blog, as it has been weeks since I last did it. Just when I had thought I was going to be working on Java at Trilogy, I changed my plans for no apparent reason and came to Microsoft. Here one, obviously, won’t work on Java. But imagine my luck, I got to work on its cousin or should I say successor (as Microsoft would like to see it IMHO; I don’t express any opinions about and of the company, this is a personal blog). This is really cool, I mean working in a familiar domain, with System.Console.println replaced by System.Console.WriteLine most of the things are same. What is not same is the GUI features provided by WinFX or Avalon framework. They are really cool, I mean we can use markup to generate complete UIs which are absolutely STUNNING. In Java or even VC++, I would have to spend hours to write the code, but thanks to the combination of C# and XAML, its a piece of cake to do so.

WinFXWinFX / Avalon

**XAML, the new tool (pronounced _zammel)_** XAML is an XML based system to create GUIs. But it can do much more than that. It provides for cool concepts like data binding. This is something like an element will automatically update its properties based on the properties of another element. So you can have the color of text in a TextBox to be the same as the Background of the Button which is an image. It as simple as writing a markup without any lines of code in C#. The power of XAML is truly phenomenal! Code:

<Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns: sys=”clr-namespace: System;assembly=mscorlib”
xmlns: x=”http://schemas.microsoft.com/winfx/2006/xaml” >
  </Page.Resources>
    <ImageBrush x:Key=”SomeImage” ImageSource=”C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg”/>
  </Page.Resources>
  <StackPanel Height=”150” Width=”350”>
    <Button Background=”{StaticResource SomeImage}” Name=”button” Height=”60”/>
    <TextBox Foreground=”{Binding Path=Background, ElementName=button}” FontSize=”20”>
      Some Text with a picture background
    </TextBox>
  </StackPanel>
</Page>

And the result!

XAML screenshotIsn’t this great? Just a few lines of code was needed to produce such an application!