WpfAppType1 ( WPF )

Reference Point:

  1. StartUpUri : http://msdn.microsoft.com/en-us/library/system.windows.application.startupuri.aspx
  2. Start-Up http://msdn.microsoft.com/en-us/library/system.windows.application.startup.aspx

void app_Startup(object sender, StartupEventArgs e)
{
// Create a window
MainWindow window = new MainWindow();

// Open a window
window.Show();
}

Objectives:
  • .Application Type concept
  • There are three types of WPF
    • Window Application : very similar to windows
    • Navigation Application
    • XBAP
  • Machine of Application Type: <Application x:Class="WpfAppType1.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="MainWindow.xaml">
  • Code : App.xaml.txt, App.xaml.cs.txt, MainWindow.xaml.txt, MainWindow.xaml.cs.txt
Step:1 Create a New project

Step:2 Implementation of winnows

A)  MainWindow.xaml

 B) MainWindow.xaml.cs : Essential Component in WPF; the Code Behind of XAML and XAML file

  • Window element must have x:Class ="NameSpace.ClassName", which would engages Microsoft Build Engine

    • In code-behind, the class must be a partial class as specified by the x:Class attribute in XAML page, and it must derive from Window.
    • In code-behind, the Window class must implement a constructor that calls the "InitializeComponent" method. InitializeComponent is implemented by the markup file's generated partial class to register events and set properties that are defined in markup.
Step:3 Manager Behind: Application Type

Step:4 Runtime views

Opens a Form-like contour, where Grid ( by default ) control serves as a root a7 container control for a WPF-Application.