1 / 29

A Lap Around Windows Presentation Foundation

A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software?. Win32. Animation. Documents. It’s Difficult!. DirectX. 3D. 2D. MFC. Data Binding. Styled Controls. Windows Forms. Video. HTML. Windows Presentation Foundation provides….

Gabriel
Download Presentation

A Lap Around Windows Presentation Foundation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Lap Around Windows Presentation Foundation

  2. Why hasn’t UX taken off in software? Win32 Animation Documents It’s Difficult! DirectX 3D 2D MFC Data Binding Styled Controls Windows Forms Video HTML

  3. Windows Presentation Foundation provides… • Unified approach to UI, Documents, and Media • Integration as part of development and experience • Integrated, vector-based composition engine • Utilizing the power of the PC • throughout the graphics stack • Declarative programming • Bringing designers directly into • application development

  4. Three “real-life” WPF Applications

  5. Windows Presentation Foundation… “Windows Presentation Foundation is the future of Windows presentation technology” • WPF is great for… • Web sites that want to push the limits of user experiences • Windows applications with complex data visualization scenarios • However, other technologies are often still better choices today • Windows Forms is still the best solution for mainstream rich client Windows applications • DirectX is still the platform for extremely intensive graphics (games, CAD applications) • ASP.NETis the reach solution for server-based platform-agnostic applications

  6. Architecture

  7. What is XAML? eXtensible Application Markup Language Declarative markup language for describing user interfaces

  8. Why Declarative? <Button Background="Red">Hello World!</Button> vs. Button btn = new Button(); btn.Background = Colors.Red; btn.Content = "Hello World!"; this.Children.Add( btn );

  9. Designer Developer Why have XAML?

  10. First Look at XAML

  11. Types of WPF applications Browser Installed

  12. A Browser-Based WPF App

  13. Layout • Canvas • StackPanel • DockPanel • WrapPanel • Grid

  14. Layout Models in WPF

  15. Controls • All standard controls represented • Some new controls • Classes are unique to Windows Presentation Foundation • System.Windows.Controls, not system.Windows.Forms.Controls

  16. Style • Lookless controls • Provide default look-and-feel, can be overridden • Logical Tree vs. Visual Tree • Logical tree is a binary representation of the source XAML • Visual tree is a scene graph which contains all the rendering data needed to compose the page • Override the Visual Tree to style controls

  17. Logical and Visual Trees <StackPanel> <ListBox> <ListBoxItem>Cat</ListBoxItem> <ListBoxItem>Dog</ListBoxItem> </ListBox> <Button>Hello World!</Button> </StackPanel>

  18. Actions • Triggers • Allow some UI events to be handled by XAML, rather than code-behind • Useful for things like “mouse over” effects • Events • Controls support all standard events such as click, key press, selection changed, etc • Events are handled in a code-behind file using either C# or VB

  19. Controls / Styles / Actions Triggers

  20. Data Binding Control Property • Target • Any property, any element • Source • CLR Object • WPF Element • ADO.NET • XML • Multiple models • One Time • One Way • Two Way Binding Property “Data Item”

  21. Putting it all together

  22. XPS Content • Fixed Documents • High-fidelity fixed layout for precise printing and viewing • WYSIWYG

  23. Content • Flow Documents • Paginated, multi-column rich text

  24. XPS Content

  25. Co-existence with Windows Forms WPF ships with technology allowing for the creation of “hybrid” applications containing both WPF and Windows Forms content.

  26. Goals of “Crossbow” • Preserve existing Windows Forms investments • Leverage existing ActiveX and 3rd party controls • Allow customers to migrate to WPF at their own pace, avoiding total rewrites

  27. “Crossbow” Technology • Services to support co-existence • Unit conversions • Focus and Keyboard management • “Extensible property” management • Two “host” controls • WindowsFormsHost • ElementHost • Simultaneous data source binding • Extend Visual Studio’s designers

  28. Limitations to “Crossbow” • Limited to only one top-level control • However, that control may be a container for many children • Windows Forms controls will always appear atop WPF controls • Limitation to Z-Order logic

  29. Windows Presentation Foundation Resources • Dev Center Guidelines • http://msdn.microsoft.com/windowsvista/experience/ • Windows Presentation Foundation Home • http://msdn.microsoft.com/windowsvista/building/presentation/default.aspx • Microsoft Expression • http://www.microsoft.com/products/expression/en/default.mspx • Interop / Migration • http://msdn.microsoft.com/winfx/reference/presentation/default.aspx

More Related