WPF LOB training @ LA Day 2

Lets see

  • DataBinding: new StringFormat markup in xaml (new in .net 3.5 sp1)
  • DataContext
  • CollectionViewSource
  • Grouping
  • ValueConverter
  • Command overview

Developer-designer workflow

  • mock-up that both designer and developer both agree to
  • developer does the UI binding and what not
  • designer does the style and template, and theme

PresentationTraceSources.TraceLevel=High

  • new in .net 3.5 sp1
  • diag:PresentationTraceSources.TraceLevel
  • diag: windows diagnostic namespace
  • it will output stuff in the debug window

ntroduction to Model-View-ViewModel

separation of concerns

  • modularity
  • loosely coupled
  • testability

empowers the designer

testability

less code

reuse to other platforms

viewmodel adapts the model to the view!!!!!!

can view talk to model directly

  • jamie: yes       reason: so we don’t need to duplicate data when some data are stored in one vi€ew-model and other view-model needs it
  • karl: no           reason: viewmodel just have a reference to model, viewmodel is an adapter for the model to the view through databinding, properties, what not

Ian: general manager for client platform and development tool team(about 300 developers) works in MSFT for about 20 yrs

  • Q: Silverlight on mobile?   A: yes! detail: you will know in future
  • Q: Silverlight on iPhone?   A: Apple says no, no silverlight runtime on iphone
  • Q: XBAP on Saferi?           A:nope
  • Q: MultiCore utilization in WPF( multi thread dispatcher, render thread)?   A: theres some primitive way. more to come in .net 4.0 free-thread UI is very hard to make it work. we will take advantage of multicore in future
  • Q: WPF documentation on MSDN is confusing especially with tags and stuff? A: will be improved in future. there is a document contains all the tag in wpf/silverlight on msdn somewhere. Rob something
  • Q: when will WPF gain mainstream acceptance?      A: conservatively speaking: 4~5 years.

MVVM Validation

Agenda:

  • validation workflow
  • validation library
  • raising validation errors
  • view – control data binding

Validation workflow

  • built-in: business object validated internally
  • rules engine: business object validated externally
  • hybrid: combination of internal and external validation

another approach (not recommended, because this way the validation rules(count as business rule) is in UI)

  • add validationrules directly to data binding

Validation library

  • enterprise library validation application block
  • CSLA – Rocky Lhotka’s Framework
  • Ocean – Karl Shifflett’s framework
  • in house library
  • binding validation rules
  • others

Advertisements
This entry was posted in WPF. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s