Introduction to Windows Presentation Framework
As we are living in competition world we should be aware of all the technologies which are available in current market. Until now I learn few of Microsoft technologies, now I entered into WPF, I want to share my experience with you. In this article I'm going to explain What is WPF and simple application using that.
Introduction to Windows Presentation Framework:
Summary:
As we are living in competition world we should be aware of all the technologies which are available in current market. Until now I learn few of Microsoft technologies, now I entered into WPF, I want to share my experience with you. In this article I'm going to explain What is WPF and simple application using that.OverView:
WPF is the next generation UI Framework to create application with a rich user experience. From .NET Framework 3.0 onwards it is available.
WPF combines UI, 2D, 3D graphics, documents and multimedia into single Framework.Separate the Appearance and behavior:
WPF Separates the appearance of an user interface from its behavior. The appearance we are generally called as "Extensible Application Markup Language (XAML)". It brings the following benefits.
• Appearance and behavior are loosely coupled.
• Designer and developer can work separately.How to create a Simple WPF Application:
Open Visual Studio and choose file->New->Project then choose WPFApplication as a Project Type and choose the work location and then click on OK.
The view is same like Windows Application, now Open Toolbox and drag & drop the TextBox and Button controls into that.
Select the button control and then open properties window then choose Events icon and then double click on Click event.
Automatically event is created in code behind side as follows; assign value to textbox when we click on button control.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 WPFApplication
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
txt1.Text = "Hello WPF!";
}
}
}Conclusion:
Hope you enjoyed this article, this may give you brief description about WPF and how to create an application using VisualStudio.