Introduction To WPF

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

lntroduction to wPl

App||cat|ons
1 tanda|one App||cat|ons
lor sLandalone appllcaLlons you can use Lhe Wlndow class Lo creaLe wlndows and dlalog boxes LhaL are
accessed from menu bars and Lool bars
owseosted App||cat|ons
lor browserhosLed appllcaLlons known as xAML browser appllcaLlons (x8As) you can creaLe
pages (age) and page funcLlons (ageluncLlon1) LhaL you can navlgaLe beLween uslng hyperllnks
(Pyperllnk classes)
@e App||cat|on C|ass
8oLh x8As and sLandalone appllcaLlons are ofLen complex enough Lo requlre addlLlonal appllcaLlon
scoped servlces lncludlng sLarLup and llfeLlme managemenL shared properLles and shared
resources 1he AppllcaLlon class encapsulaLes Lhese servlces and more and lL can be lmplemenLed by
[usL uslng xAML as shown ln Lhe followlng example
xAML
AppllcaLlon
xmlnshLLp//schemasmlcrosofLcom/wlnfx/2006/xaml/presenLaLlon
SLarLupurlMalnWlndowxaml /
1hls markup ls Lhe oppllcotloo Jefloltloo for a sLandalone appllcaLlon and lnsLrucLs Wl Lo creaLe
an AppllcaLlon ob[ecL LhaL auLomaLlcally opens MalnWlndow when Lhe appllcaLlon ls sLarLed

A key concepL Lo undersLand abouL AppllcaLlon ls LhaL lL provldes a common plaLform of supporL for
boLh sLandalone and browserhosLed appllcaLlons lor example Lhe precedlng xAML could be used by a
browserhosLed appllcaLlon Lo auLomaLlcally navlgaLe Lo a page when an x8A ls sLarLed as shown ln
Lhe followlng example
xAML
AppllcaLlon
xmlnshLLp//schemasmlcrosofLcom/wlnfx/2006/xaml/presenLaLlon
SLarLupurlPomeagexaml /
ap|cs
Wl lnLroduces an exLenslve scalable and flexlble seL of graphlcs feaLures LhaL have Lhe followlng
beneflLs
O eso|ut|on|ndependent and dev|ce|ndependent gap|cs 1he baslc unlL of measuremenL ln
Lhe Wl graphlcs sysLem ls Lhe devlce lndependenL plxel whlch ls 1/96Lh of an lnch regardless
of acLual screen resoluLlon and provldes Lhe foundaLlon for resoluLlonlndependenL and devlce
lndependenL renderlng Lach devlcelndependenL plxel auLomaLlcally scales Lo maLch Lhe doLs
perlnch (dpl) seLLlng of Lhe sysLem lL renders on
O poved pec|s|on 1he Wl coordlnaLe sysLem ls measured wlLh doublepreclslon floaLlng
polnL numbers raLher Lhan slnglepreclslon 1ransformaLlons and opaclLy values are also
expressed as doublepreclslon Wl also supporLs a wlde color gamuL (sc8C8) and provldes
lnLegraLed supporL for managlng lnpuLs from dlfferenL color spaces
O Advanced gap|cs and an|at|on suppot Wl slmpllfles graphlcs programmlng by managlng
anlmaLlon scenes for you Lhere ls no need Lo worry abouL scene processlng renderlng loops
and blllnear lnLerpolaLlon AddlLlonally Wl provldes hlLLesLlng supporL and full alpha
composlLlng supporL
O adwae acce|eat|on 1he Wl graphlcs sysLem Lakes advanLage of graphlcs hardware Lo
mlnlmlze Cu usage
5hapes
WPF provides a library o common vecLor-drawn 2-D shapes, such as Lhe recLangles and ellipses.
Geometries
1he 2-D shapes provided by WPF cover Lhe sLandard seL o basic shapes. However, you may need Lo
creaLe cusLom shapes Lo aciliLaLe Lhe design o a cusLomized Ul.
ffects
A subseL o WPF 2-D capabiliLies includes visual eecLs, such as gradienLs, biLmaps, drawings, painLing
wiLh videos, roLaLion, scaling, and skewing.
3 Rendering
WPF also includes 3-D rendering capabiliLies LhaL inLegraLe wiLh 2-D graphics Lo allow Lhe creaLion o
more exciLing and inLeresLing Uls.


An|at|on
Wl anlmaLlon supporL leLs you make conLrols grow shake spln and fade Lo creaLe lnLeresLlng page
LranslLlons and more ?ou can anlmaLe mosL Wl classes even cusLom classes
Med|a
ages
lmages are common Lo mosL appllcaLlons and Wl provldes several ways Lo use Lhem
V|deo and Aud|o
1he MedlaLlemenL conLrol ls capable of playlng boLh vldeo and audlo and lL ls flexlble enough Lo be Lhe
basls for a cusLom medla player
@ext and @pogap
1o faclllLaLe hlghquallLy LexL renderlng Wl offers Lhe followlng feaLures
O pen1ype fonL supporL
O Clear1ype enhancemenLs
O Plgh performance LhaL Lakes advanLage of hardware acceleraLlon
O lnLegraLlon of LexL wlLh medla graphlcs and anlmaLlon
O lnLernaLlonal fonL supporL and fallback mechanlsms
ocuents
Wl has naLlve supporL for worklng wlLh Lhree Lypes of documenLs flow documenLs flxed documenLs
and xML aper SpeclflcaLlon (xS) documenLs Wl also provldes Lhe servlces Lo creaLe vlew manage
annoLaLe package and prlnL documenLs
I|ow ocuents
llow documenLs are deslgned Lo opLlmlze vlewlng and readablllLy by dynamlcally ad[usLlng and
reflowlng conLenL when wlndow slze and dlsplay seLLlngs change
I|xed ocuents
llxed documenLs are lnLended for appllcaLlons LhaL requlre a preclse whaL you see ls whaL you geL
(W?SlW?C) presenLaLlon parLlcularly wlLh respecL Lo prlnLlng 1yplcal uses for flxed documenLs lnclude
deskLop publlshlng word processlng and form layouL where adherence Lo Lhe orlglnal page deslgn ls
crlLlcal
llxed documenLs malnLaln Lhe preclse arrangemenL of Lhelr conLenL ln a devlcelndependenL manner
lor example a flxed documenL LhaL ls dlsplayed on a 96 doLsperlnch (dpl) dlsplay appears Lhe same as
when lL ls prlnLed Lo elLher a 600 dpl laser prlnLer or a 4800 dpl phoLo LypeseLLer 1he layouL remalns
Lhe same ln all cases alLhough Lhe documenLs quallLy varles dependlng on Lhe capablllLles of each
devlce
O9 ocuents
xML aper SpeclflcaLlon (xS) documenLs bulld on Wls flxed documenLs xS documenLs are
descrlbed wlLh an xMLbased schema LhaL ls essenLlally a paglnaLed represenLaLlon of elecLronlc paper
xS ls an open crossplaLform documenL formaL LhaL ls deslgned Lo faclllLaLe Lhe creaLlon sharlng
prlnLlng and archlvlng of paglnaLed documenLs lmporLanL feaLures of Lhe xS Lechnology lnclude Lhe
followlng
O ackaglng of xS documenLs as Zlpackage flles LhaL conform Lo Lhe pen ackaglng
ConvenLlons (C)
O PosLlng ln boLh sLandalone and browserbased appllcaLlons
O Manual generaLlon and manlpulaLlon of xS documenLs from Wl appllcaLlons
O PlghfldellLy renderlng by LargeLlng maxlmum ouLpuL devlce quallLy
O Wlndows vlsLa prlnL spoollng
O lrecL rouLlng of documenLs Lo xScompaLlble prlnLers
O ul lnLegraLlon wlLh ocumenLvlewer

You might also like