Wednesday, March 21, 2007

XAML --1

XAML is the next next generation of the windows presentation for applications.

Think if XAML as a programing language where in the front end - GUI is all governed by XML tags...for each control which is added on the screen , there is an entry in the XAML file, in the XML node entry..

XAML is used as the front end GUI part and the Event Driven part of the XAML is coded in the back *.xaml.cs file..for example, if you want to create a message box which needs to be pop up on a click of a button of button. The Messagebox pop up code is written in the *.xaml.cs file.

1.Add the button to the XAML screen and you can see an entry like :



<--- --->

2. Now on the click button , we i have written the OnClick event.

3. The code which must be written for this click event must be written on the OnClick function in the XAML.Cs file.


MessageBox.Show("Senthil in XAML!!!!");

4.Just the above is not enogh , there needs to be a routedevent which needs to be created :


button2.Click += new RoutedEventHandler(Onb2Click);

public void Onb2Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(textBox1.Text.ToString());
}

5. Its not just the code which is written in the Clickevent , but there needs to be a RoutedEventArgs created and which is done by button2.Click += new RoutedEventHandler(Onb2Click);

[.. deep in XAML in the next posts..]
,,,,,
Senthil

No comments: