| Next Tip?
Home » Technology News

XAML in .Net : A Step Ahead Series

27 January 2009 225 views No Comment
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

<b>XAML : </b> stands for eXtensible Application Markup Language and pronounced as “<b>zammel</b>”.

<b>XAML</b> combined with the next-gen Windows graphics kernel (code-named Avalon) is an all-in-one markup language for hypertext (HTML), vector graphics (SVG), animations (Flash,SMIL), print documents (PDF,XSL-FO), forms (XForms,XUL), and much more.

The best of both worlds: In the XAML world there’s no longer a difference between a web application and a windows application. Windows is the browser kernel and Internet Explorer is just a shell.

The best of all worlds: A single programming model for media, documents and applications.

A typical XAML example:

<Window Text=”Xul Challenge 2004″>
<FlowPanel>
<SimpleText>Counter Sample</SimpleText>
<TextBox ID=”ValueTextBox” HorizontalAlignment=”Center” IsReadOnly=”True”/>
<FlowPanel HorizontalAlignment=”Center” Width=”100%”>
<Button Click=”Dec”>Dec (-)</Button>
<Button Click=”Clear”>Clear</Button>
<Button Click=”Inc”>Inc (+)</Button>
</FlowPanel>
</FlowPanel>
</Window>

<b>C# vs. XAML</b>

1. XAML-Example
<TextPanel
Background=”BlanchedAlmond”
FontFamily=”Comic sans MS”
FontSize=”36pt”
HorizontalAlignment=”Center”>
Hello, world!
</TextPanel>

2. C#-Example

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

class HelloWorldApp : Application
{
static void Main()
{
HelloWorldApp app = new HelloWorldApp();
app.Run();
}

protected override void OnStartingUp( StartingUpCancelEventArgs args )
{
Window win = new Window();
TextPanel tp = new TextPanel();

tp.Background = Brushes.BlanchedAlmond;
tp.FontFamily = “Comic sans MS”;
tp.FontSize = new FontSize( 36f, FontSizeType.Point);
tp.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
tp.TextRange.Text = “Hello, world”;

win.Children.Add(tp);
win.Show();
}
}

For more details, please refer to:

1. http://msdn.microsoft.com/en-us/library/ms752059.aspx
2. http://xaml.sourceforge.net/talk/dotnet-dec-2004/slides.html

Popularity: 1%

Post to Twitter Tweet This Post

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Ads by Lake Quincy Media

Leave your response!

You must be logged in to post a comment.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes