Introduction To Wpf   Engines
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,493
On Slideshare
1,470
From Embeds
23
Number of Embeds
3

Actions

Shares
Downloads
40
Comments
0
Likes
0

Embeds 23

http://www.linkedin.com 15
https://www.linkedin.com 7
http://www.slideshare.net 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Tamir Khason Software consulter mPrest systems [email_address] http://blogs.microsoft.co.il/blogs/tamir 06/07/09 © 2001-2007 Copyright Microsoft corporation
  • 2. Agenda
    • WTF 1 is WPF
    • WTF 2 Inside there
    • WTF 3 XAML
    • WTF 4 WPF Engines
    • WTF 5 Expression
    1 - Work Time Fun 2 - Write To File 3 - What's This For 4 - Words That Follow 5 - Way to Fly
  • 3. Windows Presentation Foundation
    • WPF is much richer then WinForms
    • XAML is cool and prevents the mess with crazy designers
    • We do not really need User Controls and Owner Draws
    • We can forget about input and output hardware
    • We want all properties to be DPs and all events to be REs
    • It’s all about data
  • 4.
    • No demos – don’t you already use it in your developments?
  • 5. Platforms? Windows XP Home/Pro SP2 Windows Server 2003 Windows Vista
  • 6. What about all things done?
    • Can use WPF with existing code
      • WPF inside existing code
      • Existing code inside WPF
    • Interop at the component level
    • Maximum richness => all WPF
  • 7.
    • Engines involved
    WTF 2 Inside there
  • 8. How to design your application
    • WPF controls are lookless – it’s all about data
    • Objects creation through properties drives behaviors
    • WPF is dynamic, sometimes too much
    • First create data, then let designer to present it
  • 9. WPF fundamentals
    • Basic Architecture
    • XAML
    • Layout
    • Controls
  • 10. Content model
    • There are only two framework elements:
      • Content and Behavior
      • Containers of Content and Behavior
    • Content element contains any kind of content via Content property
    • Item element contains any number of Content Elements via Items property and pointer to current element
  • 11. Layout model
    • WPF has only one panel, but different behaviors for this one
    • Panel behavior is an implementation a control layout
    • You have some ready made and can create your own
    • There are some layout models
      • Children, Size to Content, Alignments, Margins and Overflows
  • 12. Layout - Panels
  • 13. Dependency Property
    • Calculating of property's value based on other properties
    • Dependency property is…
      • Static fields, registered with meta data
      • CLR property
    • Attached property is a dependency property that defined by a different type than the element to which the property is applied
  • 14.
    • eXtensible Application Markup Language
    WTF 3 XAML
  • 15. XAML defines a tree of stateful objects
    • <TravelItenerary>
    • <CarTrip
    • From=&quot;Aix en Provence, France&quot; To=&quot;Paris, France&quot;
    • Time=&quot;2006/07/20T12:00&quot;
    • Duration=&quot;6:00:00&quot; />
    • <Hotel
    • Name=&quot;Under the Eiffel Tower&quot;
    • Location=&quot;Paris, France&quot;
    • Time=&quot;2006/07/20T20:00&quot;
    • CheckOut=&quot;2006/07/21T05:00&quot; />
    • <Flight
    • From=&quot;Paris, France&quot; To=&quot;London, England&quot;
    • Time=&quot;2006/07/21T7:00&quot;
    • Duration=&quot;1:15:00&quot; />
    • <Flight
    • From=&quot;London, England&quot;
    • To=&quot;Seattle, USA&quot;
    • Time=&quot;2006/07/21T16:15&quot;
    • Duration=&quot;9:30:00&quot; />
    • </TravelItenerary>
  • 16. XAML uses namespaces for extensions - xmlns:…
    • Markup Extensions
      • Used in Attribute Values to set values that aren't settable via type converters
      • XAML Language
        • {x:Null}
        • {x:Static Class.Member}
        • {x:Type wpf:Button}
      • WPF Class Library
        • {Binding …}, {StaticResource …}, {DynamicResource …}, etc…
  • 17.
    • How they make our live easier?
    WTF 4 WPF Engines
  • 18. Routed Events
    • Nothing new, but nice refreshment – regular .NET events extension
    • Can be created, changed and called
    • Can have one of following strategies
      • Direct
      • Bubbling
      • Tunneling
  • 19. Commands
    • Command = Action
    • Command != Action logic
    • Can be executed from different places
    • Can have different behaviors for different targets
    • You have some ready made and can create your own
    • Can have constraints
  • 20. Data Binding
    • WPF understands your data
      • use your favorite data model: XML, objects, SQL, WS …
      • Bind data to controls
    • Templates give your data a face
    • Controls “think” data
      • Data is pervasive across and integrated into the platform
  • 21. Data Binding
    • Target
      • Any property, any element
    • Source
      • CLR Object
      • WPF Element
      • ADO.NET
      • XML
    • Dynamic
      • INotifyPropertyChanged, DependencyProperty or PropertyDescriptor
    • Multiple models
      • One Time
      • One Way
      • Two Way
    • Value Converter
    Control “ Data Item” Property Property Binding
  • 22. Styles
    • A style is a way to change visual representation of control, by using a set of properties
    • Styles make your application to looks fun, without changing its logic
    • The separation of the presentation and logic allows designers and programmers to work simultaneously
  • 23. Templates
    • Templates are not styles, but might include
    • Templates is the way to change control’s behaviors
    • Templates is the way to change data representation
    • Templates are resources, thus might be loaded externally
  • 24. Control Templates
    • Controls have separated appearance and behavior
    • Control template = way to change behavior
    • Control appearance is the Cheshire Cat and set by styles  
    • You do not need custom controls, unless you have something new to do
  • 25. Data Templates
    • Make you data visible
    • Data Template is the way to definevisual structure of a data object
    • Data Template useable aside with binding
    • Don’t build views for displaying data, let the data to build the view
    • Might be recursive
  • 26.
    • What’s going on over designer’s scheme?
    WTF 5 Expression
  • 27. Expression Blend
    • Expression Blend is a design tool
    • Expression Blend provides tools for
      • Vector and bitmap based graphics
      • 3D, Animation
      • Rich Controls, Text Documents and more.
    • Share results with Developers who use Visual Studio to add C# or VB code and assemble the final experience.
  • 28.  
  • 29. Expression Design
    • Expression Design is even more design tool
    • Expression Design provides tools for
      • Professional and highly creative vector drawing
      • Transformation and effect features
      • An reliable XAML Exporter to convert design elements into XAML
    • Share results with Designer who use Expression Blend to add elements into layout and final markup
  • 30.  
  • 31. Expression Media and Web
    • Expression Web
      • Build websites using XHTML, ASP.NET, CSS, XML, etc.
    • Expression Media
      • Digital Asset Management and Cataloguing tool for arrangement of large amount of rich media types into logical categories.
    • Expression Studio contains of them all
  • 32. WTF n - Where's the Food?
  • 33. © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 06/07/09 © 2001-2007 Copyright Microsoft corporation