What are XAML and XML? Why we use XAML in Silverlight and WPF


XAML (read as Zammel) stands for eXtensible Application Markup Language and it is based on XML (eXtensible Markup Language). XAML is developed by Microsoft to use behind the visual representation of an application. We probably use XAML in Expression Blend or Visual Studio to develop rich media based applications for web and mobile devices. Simply, creating any application in Blend called as writing XAML code either by typing the codes or visually designing and it automatically generates code. Although XAML is developed for use on the Windows platform but the WPF/E (Windows Presentation Foundation/Everywhere) initiative will eventually bring XAML to other platforms and devices.


WPF (Windows Presentation Foundation) is a unified presentation subsystem for Windows, exposed through WinFX, the managed-code programming model for Windows Vista that extends the Microsoft .NET Framework. WPF enables developers and designers to create visually stunning, differentiated user experiences. WPF is also based on XAML, to make building applications much easier for designers.

Difference between XML and XAML

Don't confuse, XAML is based on XML but both are different subject. XML is designed to store data or works with stored data. Microsoft extends the usefulness and power of XML in form of XAML by making it a .NET programming language and extends it lot for us and the result is now here. Now as a developer, you may find yourself scripting XAML tags to write Windows or Web applications. Besides the easy to use and understand, XAML is flexible enough to provide options to use any .NET programming language as code-behind like C#, VB etc. By using XAML, you are not only limited to design UI such as size, color, and layout of Windows but you can also write the events and methods in XAML files.

Now you can ask, if XAML can develop UI and events then what will be the use of Windows Forms and ASP.NET, let's discuss.

Is XAML will replace Windows Forms and ASP.NET in future?

Well, my answer will be YES because XAML can be used in place for both Windows Forms and ASP.NET. Now you can write a single application in XAML that would work for both Windows and Web users. There is no need to use two different technologies for two different types of users. Similar to Windows Forms, XAML also support code-behind programming.

What about the HTML?

From my point of view, XAML is replacement of 'Windows Forms' and 'ASP.NET'.

Be tuned for next post because that will be coding parts.


Up Next
    Ebook Download
    View all
    View all