From few months now I have been trying to GET INTO windows vista technologies but there are so many things (Whidbey and Yukon) to learn I really have only few hours time to read about Avalon and indigo. But finally I got some time to study Avalon so I thought it might be worthy to share.
What is Avalon
So When I have heard people always asking too many questions on Avalon about What is Avalon what is its vision etc. so the answer to this question is that Avalon is a future technology to build windows Applications. Why! If we talk about developing windows application today we have bunch of programming model available to us for developing windows applications. So while we start developing our windows application we have to think of the programming model before you start your development. Another problem is cross compatibility means that if you have develop an application for GDI it not compatible with 3D and few others. But when we talk about windows it will provide a uniform development experience which will enables developers to manage UI, Documents and contents more easily and with even more flexibility. Avalon will provide echo programming model, echo user experience and echo development technologies which will enable people work effectively and efficiently.
Rich user experience
Avalon does provide development mechanisms and methodologies to use the currently build hardware for graphics to build application for rich user applications. Because of the availability of high end graphics hardware it is now eminent to provide user such UI apps which were never developed before.
XAML is a new language that is based on XML. XAML (short for eXtensible Application Markup Language, and pronounced "Zammel") is the user interface definition language for the next version of Microsoft Windows, code named Windows Longhorn. In Avalon it is used to define a tree of object, Documents, UI, contents, Graphic Contents. So that can tie the user events from C# or VB.Net.
Example (Messenger UI)
Lets take this example of Messenger UI where we have a send message type interface where a user can select a person from a list box and there is a scroll bar available and also have a text box underneath where user can type the message and when user clicks the send button, system will send that person the message written in the text box. The sample UI sample is given blow
This screen is developed using Paint and copied here but In future the Paint will have Save as feature where a user can directly save it as XAML. But for now we have to stick until next CTP release of VS.Net. Now lets talk about XAML. As I mentioned above that XAML is used to define a tree of objects. Now looking at our UI we have to define the objects in XAML.
To create Avalon Project
- Start VS.Net 2005 Beta II
- Click File -> New ->Project
- Select Avalon
You will se a XML style code page appears on the screen. This is the main area for the XAML Definition where we will define the objects. The main area of the screen is called a Grid.
<% Page language = “XXCSD” ….. %>
<RowDefintion Height=”.5In” />
<RowDefintion Height=”AutoSize” />
<RowDefintion Height=”.5In” />
<ListBox Id=”messages” Grid.Row=”1” Grid.column=”1” Grid.ColumnSan=”2” background=”#baadfood”/>
<Textbox Grid.Row = “3” Grid.column=”1” />
<Button Grid.Row=”3” Grid.Column=”2” click=”SendMessage”>Send</Button>
Compile once ….
For the click event of Button we have to go to our code behind file and define the following event
Private void SendMessage(Object sender, Eventargs e)
Run the application to see the result.
Now you can see how easy is the develop UI based application using Avalon. I haven’t test it yet just because I do not have the original version of Windows 2003 server on my laptop becoz WinFx runtime installs only on original win2k3. I will test the application on a virtual PC which has the original version. If you guys have it installed you can test this application. I am sure the code will work unless some spelling mistakes are there (I apologies because there could be). Avalon requires WinFx runtimes which are available for download at www.msdn.microsof.com\windowsvista
For comments, feedback and suggestions http://jerryyasir.blogspot.com