WPF Demystified

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Notes on slide 1

    title slide/> 0 Hello and welcome to this MSDN session on 'WPF demystified'. my name is {insert name} Let us start this session by going into more detail on exactly what we will be covering.

    Favorites, Groups & Events

    WPF Demystified - Presentation Transcript

    1. WPF Demystified Chris Koenig Developer Evangelist [email_address] http://blogs.msdn.com/chkoenig
    2. Upcoming Events
      • October
        • 9-10 – Tulsa TechFest
        • 20-22 – in.Telligent Conference
      • November
        • 4 – Election Day (Rock the Vote!)
        • 14 – Dallas Agile.NET Conference
        • 18-20 – MSDN TechDays (Dallas)
      • December
        • 8-10 – VSLive! Dallas
      • January
        • 16-18 – We Are Microsoft
    3. We Are Microsoft / GiveCamp
      • Volunteer event
      • Building web applications for local-area charities & non-profits
      • January 16-18 at BravoTECH
      • Very rewarding experience!
      • http://www.wearemicrosoft.com
      • http://www.givecamp.org
    4. What Will We Cover?
      • Essential concepts of Windows Presentation Foundation
      • How to create a data-bound, service based WPF application
    5. Helpful Experience
      • User Interface development
      • .NET language
        • VB
        • C#
      • Familiar with XML
      • Visual Studio 2008
      Level 100
    6. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    7. WPF Advantages
      • Composable Elements
      • Flexible layout engine
      • Powerful data-binding architecture
      • Impressive print, font and document capabilities
    8. WPF Advantages
      • Lookless controls
      • Styles and Templates
      • Full integration of all UI disciplines
    9. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    10. WPF Applications
      • Create WPF application with
        • Visual Studio 2008
        • Expression Blend
      • A WPF application is managed code
        • It runs on the .NET 2.0 runtime
      • Some classes similar to the WinForms model
        • Application class
        • Has Window class instead of Form class
        • Use .Show() or .ShowDialog() to display
        • Page class for forward/back navigation
      • Host WinForms controls on WPF windows
      • Host WPF controls on Winform forms
    11. Creating WPF application in Visual Studio 2008
    12. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    13. XAML
      • XAML is a declarative programming language
      • Tool friendly: Easy to persist UI structure in XAML
        • Expression Blend, ZAM 3D, Visual Studio
      • XAML is parsed by dedicated parser
        • Parser converts the tree of XML into a instances of objects
        • Most .NET types can be stored in XAML tree
          • Most likely that these will be Visual items
      • WPF, WF, Silverlight & XPS use XAML
        • Silverlight XAML is a sub-set of WPF XAML
    14. XAML
    15. XAML
    16. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    17. Layout
      • WPF includes a flexible, panel based layout engine
      • What is layout?
        • Measuring and arranging a region of WPF UI
        • All layout is handled by panels
        • Panel has ultimate control over every child
          • Child size, location, ZOrder
          • Child location relative to other children
      • Frees you from hard coding sizes/locations
        • Mix and combine panels
    18. Layout
      • Child communicates with host panel via Attached properties
        • Inform their containing panel of desired layout
        • Example: Grid.Column = "3"
        • Each panel handles one type of layout
        • Canvas: Absolute positioning
        • StackPanel: Children stacked horizontal/vertical
        • WrapPanel: Stacked, with multi children per line
        • DockPanel: Attach child to side of panel
        • Grid: Create rows/columns for children
      • Panel model is extensible with your own panels
    19. Layout
    20. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    21. Styles
      • Styles provide a convenient way to itemize a set of property values for an element type
        • Example: Set font attributes for all textboxes
      • To define a Style
        • Styles are defined in a Resource element
        • Any element in XAML can have a resource section
        • Usual locations are Page, Window and Application level
        • Named styles have a x:Key value
        • Use TargetType to limit style to one element type
    22. Styles
      • To apply a Style to an Element
        • Reference the Style by setting the Style attribute
        • Use the Markup Extension syntax '{}'
    23. Styles
    24. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    25. Using Services and DBs
      • Accessing data from WPF
        • XML
        • LINQ
          • LINQ to Objects
          • LINQ to SQL
          • LINQ to XML
          • LINQ to [your provider goes here]
        • ADO.NET
        • Entity Framework
      • Invoking Services from WPF
        • WCF
        • SOAP, REST, WS-*
    26. Using Services and DBs
      • ADO.NET Data Service
        • Code name “Astoria”
        • Exposes SQL data over HTTP via REST endpoints
        • Examples: http://localhost/CohoDS.svc/Wines
        • … Northwind.svc/Customers?$filter=contains(City,'Kent')
      • Authoring the Data Service
        • Website
        • ADO.NET Entity Data Model
        • ADO.NET Data Service
      • Consuming the DataService
        • Generate proxy with DataSvcUtil.exe
        • Use “Add Service Reference”
    27. Astoria Data Services
    28. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    29. Data Binding
      • Binding overview
        • WPF synchronizes a data source and data target
        • Add binding to target element with {Binding ***}
      • Change notification
        • WPF dependency system updates target upon source changes provided:
          • Source must implement IPropertyNotifyChanged
      • Single binding
        • Bind a target to a single property on source
        • Example: TextBlock.Text to Customer.Age
      • List binding
        • Bind a target to a array, collection etc.
        • Example: Treeview.ItemsSource to Collection object
    30. Data Templates
      • Templates provide a convenient way to centralize the replacement UI for:
        • Tabular data
        • Hierarchical data
        • Controls
      • Data Template
        • Define the UI for one Type
          • Example: Customer class
          • Render UI with six TextBlock objects and one Image
    31. Data Templates
    32. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    33. Custom Controls
      • Custom elements
        • Less need for custom elements in WPF
        • First consider getting custom look via
          • Composed UI
          • Styles
          • Templates
      • If you must create custom element choose base:
        • Existing control
        • Control
        • UserControl
    34. Custom Controls
      • User control benefits
        • Simple
        • Easy to compose sub-elements into new class
        • Easily add custom element to UI tree
      • Control library author
        • Create custom User Control
        • Compiled into assembly
      • Control consumer
        • Add reference to assembly
        • Bring namespace into scope with xmlns attribute
    35. User Controls
    36. Agenda
      • Discover the top WPF benefits
      • Creating a WPF application
      • XAML
      • Layout
      • Styles
      • Using services and databases
      • Data Templates
      • User Controls
      • Control Templates
    37. Control Templates
      • All controls in WPF are lookless
        • Each has a default UI template
        • We can replace default template with our own control template
        • Any valid UI element can be part of template
        • Templates also support binding
        • Templates do not change behavior of element
    38. Control Templates
    39. Session Summary
      • WPF is a rich UI programming framework
      • Since WPF is managed code, working with .NET APIs is easy and familiar
      • Core concept is the composable UI model
        • Create UI out of any valid WPF element
        • Mix and merge elements
        • Formalize these replacement parts with Styles and Templates
    40. For More Information
      • Online Resources
        • msdn.microsoft.com
        • windowsclient.net
        • wpfwiki.com
      • Local Community
        • adnug.org
        • agileaustin.org
        • southcentraldevelopers.com
    41. Microsoft Press Publications For the latest titles, visit www.microsoft.com/learning/books/devtools
    42. Non-Microsoft Publications These books can be found and purchased at all major book stores and online retailers
    43. Training Resources For training information and availability www.microsoft.com/learning Course ID Title 6460A Windows Presentation Foundation
    44. RAMP-UP
      • Are you ready to take your career as a developer to the next level?
      • Looking for a learning experience that is designed for you?
      • Join MSDN Ramp Up and Summit Your Career!
      • MSDN Ramp Up is your online source that provides free training and technical resources to help take your development skills to the next level.
      • Step-by-Step training plans to build your development skills.
      • Premium technical content created by expert developers for developers.
      • Access to valuable online e-learning, e-references, and virtual labs.
      • 50% discount on select certification exams and 30% discount on Microsoft Press training kits.
      • Join Ramp Up for free today!
      • Go to: http://msdn.microsoft.com/rampup
    45.  

    + Chris KoenigChris Koenig, 2 years ago

    custom

    1079 views, 0 favs, 2 embeds more stats

    From my September 25, 2008 MSDN Unleashed presentat more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1079
      • 1062 on SlideShare
      • 17 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 36
    Most viewed embeds
    • 16 views on http://blogs.msdn.com
    • 1 views on http://feeds.feedburner.com

    more

    All embeds
    • 16 views on http://blogs.msdn.com
    • 1 views on http://feeds.feedburner.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags