You are on page 1of 49

Hardcore WPF (Windows Presentation Foundation)

casey chesnut brains-N-brawn.com Madison .NET 11/ !

"ource
# Fundamenta$ demos
% htt&'//www.brains-nbrawn.com/arti(acts/HardcoreWPF.)i&

# /bac*+ow demo
% htt&'//www.brains-N-brawn.com/bac*+ow/

Which o( these wou$d you $i*e to see8

brains-N-brawn.com

# Per,asi,e -om&utin.
% Tab$et P- (M/P 0) % -om&act Framewor* (M/P 1) % 2d,anced Web "er,ices (M/P % Media -enter (M/P !) % "&eech % 4ocation 5ased "er,ices % 2rti(icia$ 6nte$$i.ence % 07

3)

9:T46NE
# # # # 9,er,iew Fundamenta$s % demos; 2&&$ication Mode$s /bac*+ow demo;

9:T46NE ' 9,er,iew

Which o( these ha,e you wor*ed with8

Now

# <76 (= years)> <76?> WinForms # 7irect@ (11 years)> 7irect07 # Auart)> 7irect"how (B years) # Prob$ems
% "howin. their a.e % Each 2P6 is di((erent % MiCin. 2P6s is cha$$en.in.

NeCt <en
# WPF % re&$aces <76 # 7irect07 % $ar.e .ames> used by WPF # Media Foundation % u$timate$y wi$$ re&$ace 7irect"how # M-M4 %mar*u& $an.ua.e (or Media -enter Edition a&&$ications # @N2 % sma$$ .ames

WPF
# -om&ositin.
% :6> 7ocuments> Media> 07> 5rowser> D

# 7ec$arati,e &ro.rammin. with @2M4 mar*u& # For 7esi.ners and 7e,e$o&ers # +ewritten (rom scratch
% % % % % 5ui$t on to& o( 7irect07 Hardware acce$erated /ector based +eso$ution inde&endent (1/E! inch) +etained .ra&hics

P$at(orms
# /ista # @P "P= # "er,er =

0 "P1

# +enders the same on each # +emote 7es*to& trans&ort # "ubsets o( WPF (@P"> WPF/E) wi$$ ma*e it to other &$at(orms

Tiers
# Tier = % 7irect@ E> "hader =. > 1=B me.s ,ideo ram (hardware renderin.) # Tier 1 % 7irect@ F> 0= me.s ,ideo ram (miCed hw/sw renderin.) # Tier % be$ow (so(tware renderin.) # 7e(au$ts to ! (&s # 2nti-a$iasin.

Time$ine
# Pi$$ar o( .NET 0.
% -$ass $ibraries bui$t on .NET =. % WPF> W-F> WF> 6n(o-ard % Past +e$ease -andidate % <o-$i,e $icenses a,ai$ab$e

# +e$eased with /ista # G9rcasH> .NET 0.@ comin. a(ter that

6nsta$$ation
# /isua$ "tudio = 3 # .NET 0. (&re-insta$$ed with /ista)
% +untime

# Windows "7I
% M"5ui$d> @2M4Pad> sam&$es

# 9rcas eCtension (or /" =

% /isua$ desi.ner> schemas> &roJect tem&$ates

@2M4Pad Microso(t EC&ression 6nteracti,e 7esi.ner

Too$s

# Windows "7I
% @2M4Pad> Per(orator> :6"&y> @P" -on(ormance> W6-EC&$orer

# /" =

% 9rcas ECtensions (beta)

# E$ectric +ain Kam 07 # Mobi(orm 2urora # Microso(t EC&ression


% <ra&hics 7esi.ner % 6nteracti,e 7esi.ner

# G9rcasH> -ider

9:T46NE ' Fundamenta$s


# @2M4> 2&&$ication> Na,i.ation> 4ayout> -ontent> 7ata 5indin.> 7e&endency Pro&erty> "ty$es> Tem&$ates> -ontro$s> E,ents> "ha&es> 7ocuments> 6ma.in.> 5itma&E((ects> 2nimation> Media> 5rushes> 07

He$$oWor$d@am$Pa.e He$$oWor$d-odePa.e

@2M4

# 7ec$arati,e obJect instantiation # Not eCc$usi,e to WPF # "e&arates :6 and $o.ic


% % % % -ommon $an.ua.e (or 7esi.ners and 7e,e$o&ers Para$$e$ de,e$o&ment 4oca$i)ation> 5randin. Tar.eted :6 (de,ices> users> D)

# Too$ su&&ort # "u&&orts -L and /5.NET

/".NET WPF a&& (rom scratch 7ra.7ro& -ider contro$s (rom Too$boC

2&&$ication

# # # # # #

<$oba$ Messa.e hand$in. 2&& e,ents (e... startu&> shutdown) Na,i.ation"er,ice Pro&erties co$$ection "tartu&:ri

@am$"yntaC

@2M4
# # # # # 9bJect e$ements> 2ttribute syntaC Pro&erty e$ements> 2bbre,iated syntaC -ontent syntaC 2ttached &ro&erties> 2ttached e,ents Mar*u& eCtensions
% 5indin. syntaC> +esource syntaC

# @m$ Names&aces # -ode-behind ,s 6n$ine ,s -ode-on$y

MainWindowTrans&arency

Window
# Window # Na,i.ationWindow # Pa.e

htt&'//$oca$host/Pa.eNa,i.ation/Pa.eNa,i.ation.Cba&

Na,i.ation
# # # # # # # Na,i.ationWindow and Frame Hy&er$in* Na,i.ation"er,ice :+6> (ra.ment su&&ort E,ents Mourna$ Pa.eFunctions

E,ents
# +outedE,ents
% Tunne$in. (Pre,iewN) and 5ubb$in.

# # # # #

E$ementTree "ty$us su&&ort (or Tab$et P-s 2ttach hand$er in @2M4 or -ode "ty$es/Tem&$ates can hand$e e,ents 5ind to e$ement with Name or C'Name

Pane$4ayout

4ayout
# 7ynamic si)in. and &ositionin. # Pane$s are *ey
% <rid> "tac*Pane$> 7oc*Pane$> Wra&Pane$> -an,as> D

# 2$i.nment
% "tretch ("i)e to container) % 4e(t> +i.ht> -enter ("i)e to content)

# Mar.in (&arent) and Paddin. (content) # 9,er($ow


% -$i&> Wra&> "cro$$> "ca$e

Too$Ti&

-ontent
# +ich -ontent
% -ontent-ontro$ % Headered-ontent-ontro$ % 6tems-ontro$ % Headered6tems-ontro$

6ntero&WinForm

6ntero&
# Hwnd"ource> HwndHost # 6ntero&s with WinForms> Win0=> 7irect@> D # 2cti,e@ intero& is throu.h WinForms intero& # -annot share airs&ace> so com&ositin. wi$$ not wor*

TwoWay5indin.

7ata 5indin.
# 7ata mode$s ' @M4> 9bJects> 7ata"ets> W-F> 46NA> D # 5indin. syntaC # 7e&endencyPro&erty # 7ata-onteCt> 7ataTem&$ate # 6Noti(yPro&erty-han.ed> 6Noti(y-o$$ection-han.ed # Modes ' 9neTime> 9neWay> TwoWay> 9neWayTo"ource

7e&endencyPro&erty
# /a$ue de&ends on some other &ro&erty
% :ser (or 7ata5indin.> "ty$es> 2nimation> D

# # # #

/a$idation 6nheritance 2ttachedPro&erties 7e(au$t ,a$ues

"ty$ed5utton

"ty$es
# # # # # # # "imi$ar to -"" +esources "etters Tri..ers 6nheritance D Tem&$ates D 2nimation

Tem&$ate5utton

Tem&$ates
# -ontro$s are bui$t based on their (unctiona$ity # The de(au$t tem&$ate can be chan.ed to radica$$y chan.e how the contro$ renders # The .oa$ is to a,oid ha,in. to create user drawn contro$s

/".NET Too$boC

-ontro$s
# -omes with a set o( standard set o( common contro$s (or :6 # :ser-ontro$
% "im&$e reusab$e contro$ % "imi$ar to a&&$ication de,e$o&ment

# -ontro$
% Pro,ides tem&$atin. % For reuse between many a&&$ications

"ha&es

"ha&es
# =7 <eometric "ha&es
% E$$i&se % 4ine % Path % Po$y.on % Po$y$ine % +ectan.$e

F$ow7ocument Fi$e % Print - @P"

7ocuments

# # # #

F$ow ,s FiCed (@P") Pac*a.in. 7ocument ,iewin. Ty&o.ra&hy


% -$earTy&e % 9&enFont % Font can be de&$oyed with an 2&&$ication

# Printin. # 2nnotatin.

6ma.in.

6ma.in.
# # # # # # # # 5MP> MPE<> PN<> T6FF> W7P> <6F> 6-9N 5itma&Frame +otation 6ma.e> 5itma&6ma.e (or @2M4 -ro&&ed5itam&> Format-on,erted5itma& -$i&&in. "tretchin. Metadata

5itma&E((ect

5itma&E((ect
# # # # # # # 2&&$ied to /isua$s -an be chained 5$ur 9uter<$ow 7ro&"hadow 5e,e$ Emboss

2nimated5utton

2nimation
# 7e&endency Pro&erties # 2nimation Ty&es ' 7oub$e> -o$or> "trin.> Point> 6nt0=> Path> D # Tar.ets ' From> To> 5y # Time based ' duration> re&etition> start times> D # "toryboards ' &ausin.> sto&&in.> resume # Iey-Frame su&&ort

Media6n*

Media
# 2udio # /ideo

5rushes

5rushes
# "o$id-o$or5rush # <radients
% 4inear<radient5rush % +adia$<radient5rush

# 6ma.e5rush # 7rawin.5rush % ,ector and bitma& # /isua$5rush % any /isua$;

Three7

07
# # # # # # # # # 5asic 07 "u&&ort /iew&ort07 -ameras Mode$s Materia$s 4i.hts Trans(orms Hit Testin. 2nimations

9:T46NE ' 2&& Mode$s


# # # # # 4oose @2M4 Windows 2&&$ication @52P / W52 WPF/E @P"

4oose @2M4
# @2M4 without any code # 9&ens in 6E # -an be dynamica$$y .enerated

2&&$ications
# # # # # Windows a&&$ication E@E with a Window or Na,i.ationWindow 6nsta$$ed 9(($ine and 9n$ine Fu$$ access

@52P / W52
# Hosted in a browser> 6E! and abo,e
% 9ther browsers> FireFoC with a &$u.in

# 9n$ine on$y # 6nternet )one &ermissions # Embed in web&a.e usin. 6Frame


% -annot interact with hostin. &a.e

# Media -enter> "idebar <ad.ets

WPF/E
# Mu$ti&$e browsers
% 5rowsers 6E3.3?> Mo)i$$a> Fire(oC> 9&era> "a(ari

# Mu$ti&$e &$at(orms
% M" ' Win=I?> M2- 9" @ 1 % 0rd &arty ' 4inuC> "o$aris

# Mu$ti&$e de,ices
% 7es*to&> PP-> "P

WPF/E
# # # # # "ubset o( WPF e... no 07 "hootin. (or = me. runtime insta$$ 9bJect ta. (or embeddin. in HTM4 WPF ? M"cri&t> 64 Pub$ic beta bits are $ate (A0 !)> browser re$ease (1st ha$( F)> de,ice su&&ort (=nd ha$( F)

@P"
# # # # # @M4 Pa&er "&eci(ication "ubset o( WPF FiCed immutab$e $ayout Ki& (ormat with resources /iewers can be &orted to other &$at(orms
% 9&en &ac*a.e s&eci(ication % @P"

# /ista &rinter s&oo$ (ormat

9:T46NE ' /bac*+ow 7emo


# brains-N-brawn.com/bac*+ow/

+esources
# 5oo*s
% 2&&$ications O -ode ? Mar*u& % Pro.rammin. Windows Presentation Foundation % @2M4 in a Nutshe$$

# Forum Windows Presentation Foundation (P2,a$onG) # News.rou& microso(t.&ub$ic.windows.de,e$o&er.win(C.a,a$on

+esources
# Webcasts
htt&'//sessions.miC !.com

# e4earnin.

7e,e$o&in. +ich EC&eriences with Microso(tQ .NET F # "am&$es


-'RPro.ram Fi$esRMicroso(tR"7IsRWindowsR,!. R"am&$esRWPF"a m&$es.)i&

+esources
# "ites
% % % %

htt&'//w&(.net(C0.com/ WPF Windows "7I 7ocumentation My Fi,e 7ay -ourse For Hittin. the WPF -ur,e/www.brains-N-brawn.com/bac*+ow/

Auestions

You might also like