SlideShare una empresa de Scribd logo
1 de 30
(.Net Framework 4.0)

•   Window Presentation Foundation (WPF) is the
    next promotion presentation system for building
    windows Client application.
•   The core of WPF is a resolution-independent and
    vector –based rendering engine that is built to task
    the advantage of modern graphics hardware.
•   WPF inherits the core with the wide-ranging set of
    application –development features.
1.1 Programming with WPF
 Located in System.Windows name space, WPF is
  presented as subset of .Net Framwork types.
 It is familiar if you have experiences building
  application with .Net Framework: instantiate classes
  set properties ,call methods, and handle events in your
  favorite language such as C# or VB.Net
 WPF incorporates additional programming construct
  that improve properties and events : dependency
  properties and routed events for supporting WPF
  abilities and simplifying programming experiences
1.2 Markup and Code Behind
One of additional enhancements for Window Client
 application development is facility in development
 using both markup and code-behind. You generally use
 Extensible Application Markup Language (XAML)
 markup to implement the appearance of an
 application while using programming language (Code-
 behind) to implement its actions.
The advantages of separating appearance and behavior :

 Reducing the cost of development and maintenance

 Making more efficient in development

 Capability of using multiple design tools to implement
 and share XAML markup and target the requirements
 of application development contributor

 Simplification of globalization and localization for
 WPF application
Markup
 XAML is XML based that is used to implement appearance
 of application declaratively. It is usually used to create
 windows, dialog boxes, pages, and user controls and to fill
 them with controls, shape and graphics.
 Here is an example of using XAML to implement
 appearance that has window and single button:
 <Window
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/p
 resentation" Title="Window with Button" Width="250"
 Height="100"> <!-- Add button to window --> <Button
 Name="button">Click Me!</Button> </Window>
Code-Behind
The main performance of an application is to realize the
 functionality that respond to user interactions
 incorporate handling events (for example clinking
 menu) and calling business logic and data access logic
 in response. In WPF, this behavior is generally
 implemented in code that is associated with markup.
 XAML
<Window
      xmlns=“http://schemas.microsoft.com/winfx/
           2006/xaml/presentation”
 xmlns:x=“ http://schemas.microsoft.com/winfx/2006/
           xaml”
 x:Class=“SDKSample.AWindow”
 Title=“Window with Button”
 Width=“250” Height=“100” >
 <!– Add button to window-->
 <Button Name=“button” Click=“button_Click”>
 Click Me!</Button>
 </Window>
using System.Windows;
namespace SDKSample
{
  public partial class Awindow:Window
  {
       public AWindow()
       {
       InitializeComponent();
       }
       void button_Click(object sender, RoutedEventArgs e)
       {
                MessageBox.Show(“Hello, WPF”);
       }
  }
}
Application
Beside the foundation of the WPF application
 development, WPF has broad features for generating
 user experiences with rich content. In order to reach
 this WPF provide types and services           that are
 collectively known as the application model. It support
 both standalone and browser-hosted applications.
 Standalone Application: you can use window class to
  create windows and dialog box that are access from
  menu bar and access bar.
 Browser-Hosted Application: or XAML browser
  applications (XBAPs), you can create page(s) and page
  function( Pagefunction-T) that you can navigate
  between using hyperlinks(Hyperlink classes).
 WPF offers the two following option for alternative
  navigation hosts: Frame (Hosting island of navigable
  content     in    either    pages     or    windows)
  NavigationWindow ( Hosting navigable content in an
  entire window)
 The Application Class: used      to encapsulate some
  services( shared properties and resources, startup and
  lifetime management…)
  <Application
  xmlns:http:”//shemas.microsoft.com/winfx/2006/
  xaml/presentation“ StartupUri=“Mainwindow.xaml”/>
 Security: Since hosting in browser         security is
  important. Partial security sandbox is used to enforce
  restriction.
Controls
 Controls was built by user experience delivered by
  application model. In WPF control is a wide-ranging
  term applied to category of WPF classes hosted in
  both pages and window, have UI and implement some
  behavior.
 Some built-in WPF controls are: Button ( Button &
  RepeatButton) DataDisplay ( Datagrid, ListView and
  TreeView) etc.
Input and Commanding
To isolate user input actions from the code responding to
  those actions WPF provides a command system.
 Layout: Key requirement of any layout is to manage to
  change in window size and display settings. Instead of
  using your code , you can use WPF first
  class, extensible layout system.
 In addition to basis of relative positioning , layout
  system manages the negotiation between control to
  determine the layout.
Layout system is exposed to child control through base
  WPF classes. For common layout such as grids,
  stacking, and docking.
 <Window
 xmlns=“http://schemas.microsoft.com/winfx/2006/
      xaml/presentation”
 xmlns:x=“http://schemas.microsoft.com/winfx/2006/
      xaml”
 x:Class=“SDKSample.LayoutWindow”
 Title=“Layout with the DockPanel”          Height=“143”
 Width=“319”>
<DockPanel>
  <Textbox DockPanel.Dock=“Top”> Dock=“Top” </Textbox>
  <Textbox DockPanel.Dock=“Bottom”>Dock=“Bottom”
             </Textbox>
  <Textbox DockPanel.Dock=“Left”> Dock=“Left”</Textbox>
  <Textbox Background=“White”> This Textbox “fills” the
  remaining space .</Textbox>
</DockPanel>
Data Binding
 Because viewing and editing data are the feature of
  most applications, WPF already provided for by many
  technologies such as Microsoft SQL Server, ADO.Net.
 Two things that WPF involve are :
    1. Copying the data from managed object into control
    2.Ensuring changes related to using control are
    copied back to the managed object.
 The core unit of data binding engine is the Binding
    class
Graphics
The following benefits which introduced by WPF
  extensively, scalablely and flexibly :
 Resolution-independent and device-independent
  graphics
 Improved Precision
 Advanced Graphics and Animation Support
 Hardware accelaration
<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/p
  resentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.EllipseEventHandlingWindow"
  Title="Click the Ellipse"> <Ellipse Name="clickableEllipse"
  Fill="Blue" MouseUp="clickableEllipse_MouseUp" />
  </Window>
C# Code
using System.Windows; // Window, MessageBox
using System.Windows.Input; // MouseButtonEventHandler
namespace SDKSample
{
public partial class EllipseEventHandlingWindow : Window {
public EllipseEventHandlingWindow()
{
InitializeComponent();
}
 void clickableEllipse_MouseUp(object sender,
  MouseButtonEventArgs e)
  { // Display a message
 MessageBox.Show("You clicked the ellipse!");
  }
}
}
Animation
Animation support allow developers to make controls
 grow, shake , spin, and fade. You can animate most
 WPF classes even custom classes.
Media
Audiovisual media is the way of demonstrating rich
  content. WPF presents special support for images
  video and audio.
 Images popular for most application and WPF
  provides several methods to use them
 Video and Audio: by using the MediaElement which is
  capable of playing both audio and video flexibly.
XAML
<MediaElement
 Name=“myMediaElement”
 Source=“media/wpf.wmv”
 LoadedBehavior=“Manual”
 Width=“350” Height=“250”/>
Text and Typography
WPF offers the following feature in order to assist high
     quality text rendering:
   OpenType font support
   ClearType enhancement
   High performance that take advantages of hardware
             speeding up
   Integration of text with media, graphics, and animation
   International font support and fallback mechanisms.
Document
WPF has native support for working with three types of
 documents, fixed documents and XML Paper
 Specification (XPS) documents.
   Flow documents are designed to optimize viewing and
    readability by dynamically adjusting and reflowing
    content when window size and display setting change.
   Fixed Documents are intended for application that
    require a precise “what you see is what you get”
    presentation respecting to the printing.
   XPS Documents are open, cross-platform document
    format     that   is   designed     to facilitate   the
    creation, sharing, printing, and archiving of paginated
    document
Document
 WPF has native support for three types documents:
  flow documents, fixed documents and XML paper
  specification(XPS) documents. WPF also provides
  another services.
 Flow documents design to optimize viewing and
  readability by dynamically adjusting and reflowing
  content when window size and display setting change.
 Fixed document : “What You See is What You Get”
  , maintain the precise agreement of their content in
  device-independent manner.
 XPL docs built on WPF’s fixed document and
  described with an XML based schema.
 Annotations in WPF , an annotation system provided
  to support sticky note and highlights. They can be
  applied to document hosted in document viewer .
 Packaging : System.IO.Packaging APIs allow
  application to organize data content and resource into
  single portable, easy to distribute and easy to access
  ZIP documents.
 Printing : WPF support many enhanced print system
  control such as real-time installation, Dynamic
  discovery…etc
Customizing WPF application
 Content Model: the type and number of items can
  constitute the content of a control is referred to as the
  control ‘s content model.
 Trigger : XAML use it to implement application
  behavior
 Control Template : You can use it to change the
  appearance of the Control’s UI without affecting it
  content and behavior.
 Data Template: let you specify appearance of control’s
  content
 Style: enable developer and designer to standardize on
  particular appearance on their application. Style
  element is foundation of WPF’s strong type model.
 Resources: WPF support for UI resources to
  encapsulate these resources in a single location for
  reuse.
 Themes and Skin: WPF does not integrate directly
  with Window themes. Because WPF’s appearance
  defined by template it include one template for each of
  the well-known Window-Themes.
       Both themes and skin in WPF are defined using
  resource dictionary.
 Custom Controls: because the existing WPF control
 do not meet the requirement you can three WPF’s
 model to create a new control.
  1.   User Control Model: derived from UserControl
  2.   Control Model: derived from Control
  3.   Framework     Element     Model:    derived    from
       FrameworkElement
WPF Best Practices
With any development platform, WPF can be used in a
 variety ways to achieve the desired outcome. It also
 required user’s experience and meet the demand of
 the audience in general.

Más contenido relacionado

La actualidad más candente

Working with Multiple Application - R.D.Sivakumar
Working with Multiple Application - R.D.SivakumarWorking with Multiple Application - R.D.Sivakumar
Working with Multiple Application - R.D.SivakumarSivakumar R D .
 
A Lap Around Windows Phone 8.1
A Lap Around Windows Phone 8.1A Lap Around Windows Phone 8.1
A Lap Around Windows Phone 8.1Puja Pramudya
 
Working with visual basic applications
Working with visual basic applicationsWorking with visual basic applications
Working with visual basic applicationsSara Corpuz
 
Window programming
Window programmingWindow programming
Window programmingPooja Rathee
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog controlSoumya Vijoy
 
Windows programming
Windows programmingWindows programming
Windows programmingBapan Maity
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightFrank La Vigne
 
Introduction to silverlight control 4
Introduction to silverlight control 4Introduction to silverlight control 4
Introduction to silverlight control 4msarangam
 
introduction to_mfc
 introduction to_mfc introduction to_mfc
introduction to_mfctuttukuttu
 
Mfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepMfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepnamtranvanpt
 
Microsoft Silverlight - An Introduction
Microsoft Silverlight - An IntroductionMicrosoft Silverlight - An Introduction
Microsoft Silverlight - An IntroductionMohammad Elsheimy
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentalsranigiyer
 
Silverlight Framework Architecture By Satyen
Silverlight Framework Architecture By SatyenSilverlight Framework Architecture By Satyen
Silverlight Framework Architecture By SatyenSatyen Pandya
 
Silverlight Framework Architecture
Silverlight Framework ArchitectureSilverlight Framework Architecture
Silverlight Framework ArchitectureAshok
 

La actualidad más candente (19)

Working with Multiple Application - R.D.Sivakumar
Working with Multiple Application - R.D.SivakumarWorking with Multiple Application - R.D.Sivakumar
Working with Multiple Application - R.D.Sivakumar
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Windows 8
Windows 8Windows 8
Windows 8
 
A Lap Around Windows Phone 8.1
A Lap Around Windows Phone 8.1A Lap Around Windows Phone 8.1
A Lap Around Windows Phone 8.1
 
Working with visual basic applications
Working with visual basic applicationsWorking with visual basic applications
Working with visual basic applications
 
Window programming
Window programmingWindow programming
Window programming
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog control
 
Windows programming
Windows programmingWindows programming
Windows programming
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 
Introduction to silverlight control 4
Introduction to silverlight control 4Introduction to silverlight control 4
Introduction to silverlight control 4
 
Vc++ 3
Vc++ 3Vc++ 3
Vc++ 3
 
introduction to_mfc
 introduction to_mfc introduction to_mfc
introduction to_mfc
 
Vb basics
Vb basicsVb basics
Vb basics
 
Mfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-stepMfc programming tutorial automation step by-step
Mfc programming tutorial automation step by-step
 
Microsoft Silverlight - An Introduction
Microsoft Silverlight - An IntroductionMicrosoft Silverlight - An Introduction
Microsoft Silverlight - An Introduction
 
Visual Basic Controls ppt
Visual Basic Controls pptVisual Basic Controls ppt
Visual Basic Controls ppt
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentals
 
Silverlight Framework Architecture By Satyen
Silverlight Framework Architecture By SatyenSilverlight Framework Architecture By Satyen
Silverlight Framework Architecture By Satyen
 
Silverlight Framework Architecture
Silverlight Framework ArchitectureSilverlight Framework Architecture
Silverlight Framework Architecture
 

Destacado

Destacado (8)

Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NET
 
Grid view in asp.net
Grid view in asp.netGrid view in asp.net
Grid view in asp.net
 
WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)WPF (Windows Presentation Foundation Unit 01)
WPF (Windows Presentation Foundation Unit 01)
 
ASP.NET 10 - Data Controls
ASP.NET 10 - Data ControlsASP.NET 10 - Data Controls
ASP.NET 10 - Data Controls
 
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Work with data in ASP.NET
Work with data in ASP.NETWork with data in ASP.NET
Work with data in ASP.NET
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
 

Similar a Chpater1

Windows presentation foundation
Windows presentation foundation Windows presentation foundation
Windows presentation foundation Debadatta Gadanayak
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Dot Net Training Dot Net35
Dot Net Training Dot Net35Dot Net Training Dot Net35
Dot Net Training Dot Net35Subodh Pushpak
 
Overview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI ControlOverview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI ControlAbhishek Sur
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedDave Bost
 
Building Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) ApplicationBuilding Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) Applicationssusere19c741
 
Building Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) ApplicationBuilding Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) Applicationssusere19c741
 
Btb017 David
Btb017 DavidBtb017 David
Btb017 DavidRohit Ray
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 DevelopmentShahed Chowdhuri
 
Adobe Flex Introduction
Adobe Flex IntroductionAdobe Flex Introduction
Adobe Flex IntroductionAmal Biswas
 
WPF - the future of GUI is near
WPF - the future of GUI is nearWPF - the future of GUI is near
WPF - the future of GUI is nearBartlomiej Filipek
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasVikash Chandra Das
 
WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2Shahzad
 
Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex senthil0809
 
Introduction to Windows App Development
Introduction to Windows App DevelopmentIntroduction to Windows App Development
Introduction to Windows App DevelopmentSourav Bhattacharya
 

Similar a Chpater1 (20)

Windows presentation foundation
Windows presentation foundation Windows presentation foundation
Windows presentation foundation
 
Silverlight Training
Silverlight TrainingSilverlight Training
Silverlight Training
 
Complete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour TechnolabComplete WPF Overview Tutorial with Example - iFour Technolab
Complete WPF Overview Tutorial with Example - iFour Technolab
 
Dot Net Training Dot Net35
Dot Net Training Dot Net35Dot Net Training Dot Net35
Dot Net Training Dot Net35
 
Overview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI ControlOverview of WPF in light of Ribbon UI Control
Overview of WPF in light of Ribbon UI Control
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
 
Building Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) ApplicationBuilding Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) Application
 
Building Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) ApplicationBuilding Windows Presentation Foundation (WPF) Application
Building Windows Presentation Foundation (WPF) Application
 
Btb017 David
Btb017 DavidBtb017 David
Btb017 David
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 Development
 
Adobe Flex Introduction
Adobe Flex IntroductionAdobe Flex Introduction
Adobe Flex Introduction
 
WPF - the future of GUI is near
WPF - the future of GUI is nearWPF - the future of GUI is near
WPF - the future of GUI is near
 
Wpf 1
Wpf 1Wpf 1
Wpf 1
 
WPF Deep Dive
WPF Deep DiveWPF Deep Dive
WPF Deep Dive
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
 
WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2WPF Windows Presentation Foundation A detailed overview Version1.2
WPF Windows Presentation Foundation A detailed overview Version1.2
 
Adobe® Flex™
Adobe® Flex™Adobe® Flex™
Adobe® Flex™
 
What is Adobe Flex ?
What is Adobe Flex  ?What is Adobe Flex  ?
What is Adobe Flex ?
 
Exploring Adobe Flex
Exploring Adobe Flex Exploring Adobe Flex
Exploring Adobe Flex
 
Introduction to Windows App Development
Introduction to Windows App DevelopmentIntroduction to Windows App Development
Introduction to Windows App Development
 

Último

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Último (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Chpater1

  • 1. (.Net Framework 4.0) • Window Presentation Foundation (WPF) is the next promotion presentation system for building windows Client application. • The core of WPF is a resolution-independent and vector –based rendering engine that is built to task the advantage of modern graphics hardware. • WPF inherits the core with the wide-ranging set of application –development features.
  • 2. 1.1 Programming with WPF  Located in System.Windows name space, WPF is presented as subset of .Net Framwork types.  It is familiar if you have experiences building application with .Net Framework: instantiate classes set properties ,call methods, and handle events in your favorite language such as C# or VB.Net  WPF incorporates additional programming construct that improve properties and events : dependency properties and routed events for supporting WPF abilities and simplifying programming experiences
  • 3. 1.2 Markup and Code Behind One of additional enhancements for Window Client application development is facility in development using both markup and code-behind. You generally use Extensible Application Markup Language (XAML) markup to implement the appearance of an application while using programming language (Code- behind) to implement its actions.
  • 4. The advantages of separating appearance and behavior :  Reducing the cost of development and maintenance  Making more efficient in development  Capability of using multiple design tools to implement and share XAML markup and target the requirements of application development contributor  Simplification of globalization and localization for WPF application
  • 5. Markup XAML is XML based that is used to implement appearance of application declaratively. It is usually used to create windows, dialog boxes, pages, and user controls and to fill them with controls, shape and graphics. Here is an example of using XAML to implement appearance that has window and single button: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/p resentation" Title="Window with Button" Width="250" Height="100"> <!-- Add button to window --> <Button Name="button">Click Me!</Button> </Window>
  • 6. Code-Behind The main performance of an application is to realize the functionality that respond to user interactions incorporate handling events (for example clinking menu) and calling business logic and data access logic in response. In WPF, this behavior is generally implemented in code that is associated with markup. XAML
  • 7. <Window xmlns=“http://schemas.microsoft.com/winfx/ 2006/xaml/presentation” xmlns:x=“ http://schemas.microsoft.com/winfx/2006/ xaml” x:Class=“SDKSample.AWindow” Title=“Window with Button” Width=“250” Height=“100” > <!– Add button to window--> <Button Name=“button” Click=“button_Click”> Click Me!</Button> </Window>
  • 8. using System.Windows; namespace SDKSample { public partial class Awindow:Window { public AWindow() { InitializeComponent(); } void button_Click(object sender, RoutedEventArgs e) { MessageBox.Show(“Hello, WPF”); } } }
  • 9. Application Beside the foundation of the WPF application development, WPF has broad features for generating user experiences with rich content. In order to reach this WPF provide types and services that are collectively known as the application model. It support both standalone and browser-hosted applications.
  • 10.  Standalone Application: you can use window class to create windows and dialog box that are access from menu bar and access bar.  Browser-Hosted Application: or XAML browser applications (XBAPs), you can create page(s) and page function( Pagefunction-T) that you can navigate between using hyperlinks(Hyperlink classes).  WPF offers the two following option for alternative navigation hosts: Frame (Hosting island of navigable content in either pages or windows) NavigationWindow ( Hosting navigable content in an entire window)
  • 11.  The Application Class: used to encapsulate some services( shared properties and resources, startup and lifetime management…) <Application xmlns:http:”//shemas.microsoft.com/winfx/2006/ xaml/presentation“ StartupUri=“Mainwindow.xaml”/>  Security: Since hosting in browser security is important. Partial security sandbox is used to enforce restriction.
  • 12. Controls  Controls was built by user experience delivered by application model. In WPF control is a wide-ranging term applied to category of WPF classes hosted in both pages and window, have UI and implement some behavior.  Some built-in WPF controls are: Button ( Button & RepeatButton) DataDisplay ( Datagrid, ListView and TreeView) etc.
  • 13. Input and Commanding To isolate user input actions from the code responding to those actions WPF provides a command system.  Layout: Key requirement of any layout is to manage to change in window size and display settings. Instead of using your code , you can use WPF first class, extensible layout system.  In addition to basis of relative positioning , layout system manages the negotiation between control to determine the layout.
  • 14. Layout system is exposed to child control through base WPF classes. For common layout such as grids, stacking, and docking. <Window xmlns=“http://schemas.microsoft.com/winfx/2006/ xaml/presentation” xmlns:x=“http://schemas.microsoft.com/winfx/2006/ xaml” x:Class=“SDKSample.LayoutWindow” Title=“Layout with the DockPanel” Height=“143” Width=“319”>
  • 15. <DockPanel> <Textbox DockPanel.Dock=“Top”> Dock=“Top” </Textbox> <Textbox DockPanel.Dock=“Bottom”>Dock=“Bottom” </Textbox> <Textbox DockPanel.Dock=“Left”> Dock=“Left”</Textbox> <Textbox Background=“White”> This Textbox “fills” the remaining space .</Textbox> </DockPanel>
  • 16. Data Binding  Because viewing and editing data are the feature of most applications, WPF already provided for by many technologies such as Microsoft SQL Server, ADO.Net.  Two things that WPF involve are : 1. Copying the data from managed object into control 2.Ensuring changes related to using control are copied back to the managed object.  The core unit of data binding engine is the Binding class
  • 17. Graphics The following benefits which introduced by WPF extensively, scalablely and flexibly :  Resolution-independent and device-independent graphics  Improved Precision  Advanced Graphics and Animation Support  Hardware accelaration
  • 18. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/p resentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SDKSample.EllipseEventHandlingWindow" Title="Click the Ellipse"> <Ellipse Name="clickableEllipse" Fill="Blue" MouseUp="clickableEllipse_MouseUp" /> </Window> C# Code using System.Windows; // Window, MessageBox using System.Windows.Input; // MouseButtonEventHandler namespace SDKSample { public partial class EllipseEventHandlingWindow : Window {
  • 19. public EllipseEventHandlingWindow() { InitializeComponent(); } void clickableEllipse_MouseUp(object sender, MouseButtonEventArgs e) { // Display a message MessageBox.Show("You clicked the ellipse!"); } } }
  • 20. Animation Animation support allow developers to make controls grow, shake , spin, and fade. You can animate most WPF classes even custom classes.
  • 21. Media Audiovisual media is the way of demonstrating rich content. WPF presents special support for images video and audio.  Images popular for most application and WPF provides several methods to use them  Video and Audio: by using the MediaElement which is capable of playing both audio and video flexibly.
  • 22. XAML <MediaElement Name=“myMediaElement” Source=“media/wpf.wmv” LoadedBehavior=“Manual” Width=“350” Height=“250”/>
  • 23. Text and Typography WPF offers the following feature in order to assist high quality text rendering:  OpenType font support  ClearType enhancement  High performance that take advantages of hardware speeding up  Integration of text with media, graphics, and animation  International font support and fallback mechanisms.
  • 24. Document WPF has native support for working with three types of documents, fixed documents and XML Paper Specification (XPS) documents.  Flow documents are designed to optimize viewing and readability by dynamically adjusting and reflowing content when window size and display setting change.  Fixed Documents are intended for application that require a precise “what you see is what you get” presentation respecting to the printing.  XPS Documents are open, cross-platform document format that is designed to facilitate the creation, sharing, printing, and archiving of paginated document
  • 25. Document  WPF has native support for three types documents: flow documents, fixed documents and XML paper specification(XPS) documents. WPF also provides another services.  Flow documents design to optimize viewing and readability by dynamically adjusting and reflowing content when window size and display setting change.  Fixed document : “What You See is What You Get” , maintain the precise agreement of their content in device-independent manner.
  • 26.  XPL docs built on WPF’s fixed document and described with an XML based schema.  Annotations in WPF , an annotation system provided to support sticky note and highlights. They can be applied to document hosted in document viewer .  Packaging : System.IO.Packaging APIs allow application to organize data content and resource into single portable, easy to distribute and easy to access ZIP documents.  Printing : WPF support many enhanced print system control such as real-time installation, Dynamic discovery…etc
  • 27. Customizing WPF application  Content Model: the type and number of items can constitute the content of a control is referred to as the control ‘s content model.  Trigger : XAML use it to implement application behavior  Control Template : You can use it to change the appearance of the Control’s UI without affecting it content and behavior.  Data Template: let you specify appearance of control’s content
  • 28.  Style: enable developer and designer to standardize on particular appearance on their application. Style element is foundation of WPF’s strong type model.  Resources: WPF support for UI resources to encapsulate these resources in a single location for reuse.  Themes and Skin: WPF does not integrate directly with Window themes. Because WPF’s appearance defined by template it include one template for each of the well-known Window-Themes. Both themes and skin in WPF are defined using resource dictionary.
  • 29.  Custom Controls: because the existing WPF control do not meet the requirement you can three WPF’s model to create a new control. 1. User Control Model: derived from UserControl 2. Control Model: derived from Control 3. Framework Element Model: derived from FrameworkElement
  • 30. WPF Best Practices With any development platform, WPF can be used in a variety ways to achieve the desired outcome. It also required user’s experience and meet the demand of the audience in general.