Академический Документы
Профессиональный Документы
Культура Документы
WPF is a radical departure from the established way of building Windowsbased apps
Subindev P
What is WPF
A productive, unified approach to UI, media and documents to deliver unmatched UX. Not only about UI Controls. Introduced a new programming model.
ASP.NET 2.0
WCF
WF
WPF
Card space
WPF Flavours
WPF
Windows Application
Runs on the client desktop Equivalent to a Windows Forms Application
Silverlight
Cross browser, Cross Platform plug-in for creating rich internet applications
Why WPF?
With all the existing UX technologies what does WPF give us?
Implementation difficulty can be a huge barrier to pleasing and efficient user experience Etc
Advantage WPF
Greater hardware capabilities used Declarative programming XAML Integrated Platform Powerful features
Developer-Designer workflow Many Tools emit XAML
Demo
WPF Architecture
.NET DirectX Graphics pipeline of WPF
presentationcore
milcore
Coordinate System
Coordinate system is basically the same as in GDI
0,0 is top left of coordinate space Y-axis points down, X-axis points right Coordinates are doubles in WPF instead of integers Z-index by default is applied from bottom to top in the order of the elements in the visual tree. Panel.ZIndex allow this behavior to be changed.
Demo
XAML
eXtensible Application Markup Language Declarative markup language for UI design If you learn XAML, then you can program UI in, WPF Silverlight WP7 WinRT
XAML, cont.
XML-based serialization format for CLR objects
Eg. Class Property Event : Button : Height, Background : b_Click
XAML, cont.
Xaml compiler compiles XAML into BAML BAML is a binary representation of the XAML optimized for runtime loading. The compiled BAML is embedded into the resources of the assembly.
XAML, cont.
Any CLR namespace can be mapped into XAML:
<Window xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:my='clr-namespace:MyClrNamespace;assembly=MyAssembly>
XAML can also be used for things other than WPF UI declaration.
For example: Windows Workflow uses XAML to describe their workflows. (They call it XOML).
Managed Code
When compiled, the XAML file is used to generate a code file
Eg. Window1.g.cs Partial class
XAML files can be paired with managed code-behind files which are also marked as partial classes.
Partial classes are a feature of the .NET Framework 2.0
Application Class
The Core of the WPF Application Model Application Message Dispatching Provides Application Events Application
Application.Run method
Serves as a container for WPF applications Allows data to be shared across pages
Lifetime: Activated, Current, Deactivated, Dispatch erUnhandledException, Exit, Run, SessionEnding, Shu tdown, ShutdownMode, Startup.
Note :- We can create a WPF application without Application class. But XBAP required one.
Element Composition
Element composition is at the heart of WPFs user interface model An element may contain one or more child elements, which in turn, may contain additional elements
Deployment
ClickOnce Deployment
A .NET Framework 2.0 Technology
Preferred method of deployment for WPF applications
Both installed and browser-hosted
MSI Deployment
WPF applications can also be deployed using a traditional MSI-based installation routine
Security
Full Trust Applications
Installed applications run with full trust Have complete access to system resources If installed through ClickOnce, the user is prompted for authorization
Similar to Win32 applications
Browser applications run with partial trust Have limited access to system resources If installed through ClickOnce, the user is not prompted for authorization
Cannot compromise system security
With Internet Zone permissions
Development Tools
Visual Studio Expression Suite XamlPad (SDK Tool) Perforator (SDK Tool) Snoop - http://www.blois.us/Snoop/ Kxaml
Thank You