WPF is officially released. The tooling however to create i.e. XAML pages is in a very early state. The tools available at the time of writing can be found at the bottom of this page under resources. Therefore the amount of time it needs to write a WPF enabled application takes roughly 3 times longer than it should take, because of minimal tooling support. However it can still make sense to develop a WPF application, i.e. when the requirements of the app can be far more easily covered by an application using WPF.
Why is WPF such a revolution in UI design? The last transistion of the UI was 20 year ago. Every UI up until now was based upon GDI, invented in 1984. WPF is build on top of DirectX, which is capable of using all the power of graphic cards that are available to those stunning games also.
Furtermore it is vector based, making it possible to zoom without loss of detail.
In an attempt to fill in the gap between the rich UI experience on with Windows Forms on the web, a subset of WPF will be created by Microsoft, which is currently known as WPF/e (the e stands for everywhere). Some features are missing, like i.e. 3D. But WPF/e does not require .NET 3.0. It's even platform independent. It therefore supports MAC and Linux also. WPF/e will be introduced before the end of 2007. It will be a serious competitor for the nowadays widely used Flash.
User interfaces can be specified by XAML files (pronounced "Zammel"). XAML is an XML file, that describes the user interface as an hierarchy of (visual) elements. XAML is a big step towards declarative programming- Decalre what you want, not how it happens.
WPF Application Model:
- Application objects as entry point
- StartingUp, ShuttingDown events
- Run method, MainWindow property, etc.
- Visual elements
- Page, Window
Sampleviewer (installed with "Visual Studio 2005 extensions for .NET Framework 3.0", currenlty a CTP) takes you around all the features of WPF one by one.
Differences between WPF and Windows Forms
- No MDI in WPF
- No build-in data grid in
- WPF has "container/control" distinction
- No Controls collection"Visible" > "Visiblity" in WPF
- "Hidden" takes up space
- "Collapsed" doesn't take up space
- Absolute position in WPF is the exception, not the rule
- Sizing and positioning are in device independent units (1/96 inch) in WPF
- Scrolling is external to controls
- ScrollViewer element
- Non-containers can only hold one element
- Called the controls "content"
- Set with the Content property
- Content can be any visual element
- Content can itself be a container
- Create a collection of stuff
- Bind it to the context of the window
- Bind controls to the item properties
- Add navigation, filtering, sorting, and so forth
XAML Based Application (XBAP) are WPF enabled applications which can be used within a browser.
- Act a lot like HTML pages
- Non-installed, served from a web server
- Browser hosted on the client (take over the whole browser surface)
- Run in a security sandbox
- Have their own project type under Visual Studio
- Caution - March CTP bug on Vista
- Published to Virtual Directory on web server
- "NavigateURI" attributed used on links to navigate pages
- App has read permissions to its original web directory
- Can use IsolatedStorage for caching and state management.
Animation can consist of:
- 2D and 3D Transforms
Styles can be applied on the fly trough code or to triggers (i.e. hovering a button).
Ink is enabled in WPF (on Windows XP, after installing appropriate libaries).
3D Rendering of surfaces
- Use full 3D capabilities underneath
- Compose surfaces out of triangles
- Triangle is the only primitive
- Created as of MeshGeometry3D
- Viewport3D is visual element to render 3D objects on screen in 2D
- Apply camera angle, for example, to this viewport
- Exporter for Autodesk 2DS Max is not (yet) official available
Types of events within the tree hierarchy of an WPF application
- Direct (only on element)
- Bubbling (move up the tree)
- Tunneling events (from outside into the tree and down to the elements)
Tools for XAML:
- XamlPad from Microsoft, part of the Windows SDK.
- Expression Blend from Microsoft. Tool for desiging user interface targetted at integrators between developers and professional designer.
- WPF CTP November 2006 from Microsoft.
- WPF/e CTP feb. 2007.
- http://channel9.msdn.com/wiki/default.aspx/WPF.ApplicationPortfolio, WPF samples in action
- Windows Presentation Foundation SDK
- Tim Sneath, Microsoft
- Scott Gu, Microsoft
- Rob Relyea
- Erno de Weerd, Infosupport
Examples of XAML Based Applications:
- British Library, using WPF and thus requires Windows and .NET 3.0 installed at the client PC.