Chapter 5: Windows Presentation Foundation's objectives is a vital component to the future of application development, allowing developers to take control of the sheer power that is available at the desktop to develop rich, interactive, media-enhanced user interfaces...”.
AMBIENT/
Chủ đề:
Nội dung Text: Chapter 5: Windows Presentation Foundation - Do Thi Ngoc Quynh
- Chapter 5.
Windows Presentation Foundation
Do Thi Ngoc Quynh
Ha Noi University of Technology
1
- Objectives
“The Windows Presentation Foundation is a vital
component to the future of application development,
allowing developers to take control of the sheer power
that is available at the desktop to develop rich,
interactive, media-enhanced user interfaces...”
Microsoft 2
- Agenda
WPF Introduction
XAML
Programming WPF Applications
Building Your First WPF Application
Exploring the Layout Controls
Working with XAML Controls
Working with Graphics, Media and Animations
New in WPF 3.5
Future Directions of WPFSummary
Microsoft 3
- Part 1
WPF Introduction…
Microsoft 4
- Presentation Layer Architecture: From
Yesterday to Tomorrow
Punch-card request/response Terminal-based request/response
architecture architecture
Microsoft 5
- Presentation Layer Architecture: From
Yesterday to Tomorrow
Request/response architecture of user graphical user interface (GUI) application
talking to mainframe
Microsoft 6
- Presentation Layer Architecture: From
Yesterday to Tomorrow
Web browser–based request/response architecture Sophisticated browser architecture
Microsoft 7
- Presentation Layer Architecture: From
Yesterday to Tomorrow
The .NET Framework provides consistent browser, desktop, and server application
programming interfaces (APIs)
Microsoft 8
- How you develop your client
applications?
One set of technologies—based on HTML, DHTML,
Asynchronous JavaScript and XML (Ajax), and Microsoft
ASP.NET Atlas
gives you the same level of sophistication that a “heavy” client
can give you using “light” technologies
The other approach: WPF
including a declarative XML markup language named Extensible
Application Markup Language (XAML) that defines the user
interface, but has an incredibly powerful runtime supporting it
Microsoft 9
- The Windows SDK
The Windows SDK contains all the APIs for developing
next-generation Windows applications
provides the foundation for software development for the
Windows server and client platforms for the foreseeable future
The Windows SDK is centered on the .NET Framework
3.0, sometimes called NetFX
which contains the classes you are familiar with from the .NET
Framework 2.0 in addition to WPF, WCF, and WWF
Microsoft 10
- Windows Presentation Foundation
(WPF)
Latest UI development platform from MSFT
Integration of:
2D graphics
3D graphics
video/audio/animation
Declarative/Procedural programming model:
XAML
C#/Visual Basic/etc…
Microsoft 11
- WPF Features and Machinery
Control library
buttons, sliders, menus, toolbars
tool tips, popups, scroll bars, etc…
user defined as well
Layout panels
canvas, stack, wrap, doc panels
grid – most flexible
Actions
events
commands
Triggers
Styles, skins, themes, templates
Microsoft 12
- WPF - Architecture
Microsoft 13
- Tools of the Trade
If you want to get started developing WPF applications,
you’ll need to download and install the various tools,
runtimes, and SDKs
Visual Studio 2005 or Visual Studio 2008/2010
Microsoft Expression
http://www.microsoft.com/expression
The WinFX Runtime Components
The Windows Software Development Kit (SDK)
Visual Studio Development Tools for WinFX
Microsoft 14
- Part 2
XAML...
Microsoft 15
- What is XAML?
Extensible Application Markup Language
For describing hierarchies of objects
For:
Developers
Designers
Code generators
Microsoft
- Why do we need XAML?
Used by WPF, WF
Also usable for your own purposes
No more choosing between C# or VB.NET
Microsoft
- XAML vs. Code
XAML and code can do the same thing
Xml tag
creates object
Xml attribute
sets property
value
Microsoft
- Install event handler
When button is
Attributes and Events clicked
Attributes can also set event handlers
Microsoft
- Nesting elements
Nesting elements means nesting objects
Canvas c= new Canvas();
Nesting adds one
object
to another object
(if supported)
Microsoft