HI All, I am very new to write article. So
I choose WPF to write. This is my first application in WPF. This is a simple
application in which I am showing how we can start to play with WPF.
Open Visual Studio -> New -> Project -> Select
WPF Application

Image 1.
Below is the default structure..

Image 2.
Now I am going to use a TextBox and Button in this
application. On click of button I am showing a text in text box.
Drag and drop button and text box from tool box

Image 3.
Output is:

Image 4.
My XAML code is:
<Window x:Class="MyFirstWPF_APP.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<Button Margin="102,122,102,117" Name="button1" Click="button1_Click">Click Me</Button>
<TextBox Height="23" Margin="23,51,33,0" Name="textBox1" VerticalAlignment="Top" />
</Grid>
</Window>
My XAML.cs code is:
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 MyFirstWPF_APP
{
/// <summary>
/// Interaction logic for
Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void
button1_Click(object sender, RoutedEventArgs e)
{
textBox1.Text = "Welcome to WPF";
}
}
}