WPF introduced in the .net framework 3.0. WPF introduced highly rich features for windows client application that includes XAML, data binding, controls, 2-D and 3-D Graphics, Media, Document, Dependency Property etc. apart from this with the help of WPF you can create both standalone application and web based application which is known as XBAP(XAML browser application)
XAML stands for extensible application markup language. It simplifies creating a UI for a .net framework application. XAML allows us to design up and logic on different tools.
Open Visual Studio->File->Project Following window will be opened:-
Figure 1
Select window tab from left and after that select WPF Application. When you click ok you will see two Pages – one is .xaml and second is .xaml.cs
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
This is the Example of WPF
</Window>
I simply add text in the windows.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication2
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
When I execute this application it will show output as follows:-
Figure 2
As you can see that its showing the Title MainWindow. We can customize the window according to us.
I customize the height and width and Title of the window
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Tech Altum" Height="500" Width="700">
This is the Example of WPF
</Window>
Now it will show the following output:-
Figure 3
For any query you can send mail at info@techaltum.com Thanks