1 / 27

.Net 3.0 and Windows Presentation Foundation

Explore the key features and benefits of .Net 3.0 and Windows Presentation Foundation (WPF). Learn about the programming models, elements, controls, and styling options offered by WPF.

pipkins
Download Presentation

.Net 3.0 and 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. .Net 3.0 and Windows Presentation Foundation Jim Fawcett CSE775 – Distributed Objects Spring 2007

  2. References • Introducing Windows Presentation Foundation, David Chappell, http://msdn2.microsoft.com/en-us/library/aa663364.aspx • Several figures used from this presentation • Introducing Windows Communication Foundation, David Chappell, http://www.davidchappell.com/IntroducingWCFv1.2.1.pdf • Several figures used from this presentation • Foundations of Windows Presentation Foundation, Laurence Moroney, Apress, 2006 • Scalable Vector Graphics (SVG), XML Graphics for the Web, http://www.w3.org/Graphics/SVG/

  3. References • Introduction to Vector Markup Language (VML), http://msdn.microsoft.com/library/default.asp?url=/workshop/author/vml/default.asp • Windows Presentation Foundation, Ronnie Saurenmann, www.00001001.ch/Download/WebSummit/WPF.ppt • Windows Presentation Foundation, Sue Chard, www.devlab.ac.nz/dotnetlink/wpf.ppt

  4. .Net 3.0 • The .Net 3.0 Framework has support for three major pieces, available for Vista, XP, and Server 2003: • Windows Work Flow (WF) • Windows Communication Foundation (WCF) • Windows Presentation Foundation (WPF) • There is a fourth piece, Media Foundation, available only on Vista • A COM multi-media framework, designed to replace DirectShow, Windows Media SDK, DirectX media, etc. • Won’t be available on XP. • Basic tools (command line compilers etc) and Framework classes support these. • New, more productive, tools are coming with the Orcas release of Visual Studio, later this year.

  5. Windows Work Flow (WF) • Windows Work Flow is: • An execution engine for code-based activities • Essentially an attempt at simplifying organization of programs. • Executes activity blocks and sequences between blocks based on connectivity and control constructs, or based on events. • Runs in two modes: • Sequential is essentially a flow-chart execution engine • State is a state-machine execution engine • Discussion I’ve read indicates that it is oriented primarily toward implementing “Business Rules”. • Workflows are programmed in XAML (used to be called XOML in WF. The O stood for Object.

  6. All diagrams from Chappell, IWPF

  7. Windows Communication Foundation • Convergence of application programming models for communication, supporting: • Web Services (Asp Web Services) • Web Applications (Asp.Net) • Windows Services (NT Services) • Remoting (.Net Remoting) • Queuing (MSMQ) • Can be hosted in: • IIS • Windows Services • Windows Applications

  8. WCF Services Chappell (IWCF)

  9. Windows Presentation Foundation • Convergence of presentation programming models, Supporting: • Desktop applications • WinForms, MFC, WTL, Win32 • Web applications • Asp.Net • Document presentation • Word Documents

  10. Chappell (IWPF)

  11. Chappell (IWPF)

  12. Elements of WPF • Scalable Vector Graphics • It is not clear whether WPF is based on standard SVG or on Microsoft’s proprietary Vector Markup Language (VML) • eXtensible Application Markup Lanaguage (XAML) • A dilect of XML with tags defined for specific graphics (or other application) operations:<Rectangle Width="30" Height="10" Fill="HorizontalGradient Red Yellow" /> • CodeBehind • Event handler code

  13. Applications Controls Styling Layout Data Content Action Presentation Framework Adapted from Chard (WPF) PresentationCore.dll - managed MilCore.dll – unmanaged composition DirectX – a COM technology Driver

  14. Features • Programming • Declarative programming with XAML • Imperative programming with classes from System.Windows namespace • Interop with Forms • Host Forms controls on WPF pages • Host WPF controls on Forms

  15. WPF Support for Presentation • Presentation mode: • Window: basic display windows • NavigationWindow: hyperlinked navigation • Layout: • DockPanel: Flow layout like a web page • StackPanel: Linear layout, ala toolbars • Grid: Absolute positioning on grid • Canvas: Free positioned layout • Controls: • All the usual plus new addtions • Supports custom controls

  16. Styles • Cascading Style Sheets • It is not clear that WPF directly supports CSS • WPF does have DataTemplate and ControlTemplate classes that support styling data layouts and controls. • Style element class: • <style>…</style> • Inline styles: • <Button style=“{StaticResource ButtonStyle}”>a title</Button>

  17. Documents • Typography: • OpenType fonts • ClearType • Glyphs • Documents • FixedDocument class • Layout is fixed for rendering in any window or printer, does not flow • FlowDocument class • Uses browser flow model • Lots of control over the details of how that is done through properties

  18. Media • Images • <Image width=“200” Source=“C:\temp\us.jpg” /> • Can have metadata • Can be painted onto 3D canvases • Video • <MediaElement Source=“c:\temp\myVid.wmv” /> • Handles wmv, mpeg, avi, wav, …

  19. <Border Width="400" BorderBrush="Green" BorderThickness="9"> <StackPanel> <MediaElement Source="aero.wmv" /> <Button>Hello</Button> </StackPanel> </Border> Audio & Video Ronnie Saurenmann (WPF) • Formats: WMV, MPEG, Some AVIs • Can be synchronized with animations • Windows Media Foundation used to instantiate playback machinery into a DirectShow graph

  20. 2D Graphics • Support for primitives: • Line, Ellipse, Rectangle, Polygon, Polyline, Path • Support for defining regions: • LineGeometry, RectangleGeometry, …

  21. 2D Graphics, 3D Graphics, Imaging Ronnie Saurenmann (WPF) 2D Graphics 3D Graphics Imaging

  22. 3D Graphics • Viewport3D control • Models • Define shape, lighting, viewing • GeometryModel3D class • SpecularMaterial class • DiffuseMaterial class • DirectionalLight • AmbientLight • PerspectiveCamera • OrthographicCamera

  23. Transformations • RotateTransform • ScaleTransform • RenderTransform • Blur and glow effects

  24. Animations • Storyboard class • Defines element(s) to which animation applies, by name • Initial properties like size and position • Range of changes of those properties with duration settings (time between changes)

  25. Combining Stuff • Most of the WPF elements can be containers: • Can put an ellipse in a button • Graphics figures, controls, animations, … can be freely mixed and applied to each other.

  26. Applications • Desktop applications • Full trust • Rich, but familiar applications • XAML Browser Applications (XBAPS) • Lowered trust • Many operations are not allowed, e.g., access to local file system • May appear very like an equivalent desktop application • Most of the code is the same

  27. End of Presenation

More Related