Dot Net - Chapter-12
Dot Net - Chapter-12
Lecture notes
Chapter-12
- WPF extends the core with a set of application-development features that include
Extensible Application Markup Language (XAML), controls, data binding, layout, 2-D and
3-D graphics, animation, styles, templates, documents, media, text, and typography.
- WPF is included in the Microsoft .NET Framework, so you can build applications that
incorporate other elements of the .NET Framework class library.
Features :
Standalone Applications
For standalone applications, you can use the Window class to create windows and
dialog boxes that are accessed from menu bars and tool bars.
Browser-Hosted Applications
For browser-hosted applications, known as XAML browser applications (XBAPs), you can
create pages and page functions that you can navigate between using hyperlinks
Code-Behind
The main behavior of an application is to implement the functionality that responds to
user interactions, including handling events (for example, clicking a menu, tool bar, or
button) and calling business logic and data access logic in response. In WPF, this
behavior is generally implemented in code that is associated with markup. This type of
code is known as code-behind.
Security
Because XBAPs are hosted in a browser, security is important. In particular, a partial-
trust security sandbox is used by XBAPs to enforce restrictions that are less than or
equal to the restrictions imposed on HTML-based applications.
Data Binding
Most applications are created to provide users with the means to view and edit data.
For WPF applications, the work of storing and accessing data is already provided for by
technologies such as Microsoft SQL Server and ADO.NET.After the data is accessed and
loaded into an application's managed objects, the hard work for WPF applications
begins.
Graphics
WPF introduces an extensive, scalable, and flexible set of graphics features that have
the following benefits:
- Resolution-independent and device-independent graphics.
- Improved precision.
- Advanced graphics and animation support.
- Hardware acceleration.
3-D Rendering
WPF also includes 3-D rendering capabilities that integrate with 2-D graphics to allow
the creation of more exciting and interesting UIs.
Animation
WPF animation support lets you make controls grow, shake, spin, and fade, to create
interesting page transitions, and more. You can animate most WPF classes, even custom
classes.
Media
One way to convey rich content is through the use of audiovisual media. WPF provides
special support for images, video, and audio.
Images
Images are common to most applications, and WPF provides several ways to use them.
Documents :
WPF has native support for working with three types of documents: flow documents,
fixed documents, and XMLPaper Specification (XPS) documents. WPF also provides the
services to create, view, manage, annotate, package,and print documents.
Packaging
The WPF System.IO.Packaging APIs allow your applications to organize data, content,
and resources into single, portable, easy-to-distribute, and easy-toaccess ZIP
documents. Digital signatures can be included to authenticate items that are contained
in a package and to verify that the signed item was not tampered with or modified. You
can also encrypt packages by using rights management in order to restrict access to
protected information.
Triggers
Printing
The .NET Framework includes a printing subsystem that WPF augments with support for
enhanced print system control.
- While creating such applications was possible prior to the existence of WCF, WCF makes
the development of endpoints easier than ever. In summary, WCF is designed to offer a
manageable approach to creating Web services and Web service clients.
Features of WCF
Service Orientation
Service-oriented architecture (SOA) is the reliance on Web services to send and receive
data. The services have the general advantage of being loosely-coupled instead of hard-
coded from one application to another. A loosely-coupled relationship implies that any
client created on any platform can connect to any service as long as the essential
contracts are met.
Interoperability
WCF implements modern industry standards for Web service interoperability.
Service Metadata
WCF supports publishing service metadata using formats specified in industry standards
such as WSDL, XML Schema and WS-Policy. This metadata can be used to automatically
generate and configure clients for accessing WCF services. Metadata can be published
over HTTP and HTTPS or using the Web Service Metadata Exchange standard.
Data Contracts
Because WCF is built using the .NET Framework, it also includes code-friendly methods
of supplying the contracts you want to enforce. One of the universal types of contracts
is the data contract. In essence, as you code your service using Visual C# or Visual Basic,
the easiest way to handle data is by creating classes that represent a data entity with
properties that belong to the data entity. WCF includes a comprehensive system for
working with data in this easy manner. Once you have created the classes that
represent data, your service automatically generates the metadata that allows clients to
comply with the data types you have designed.
Security
Messages can be encrypted to protect privacy and you can require users to authenticate
themselves before being allowed to receive messages. Security can be implemented
using well-known standards such as SSL or WS-Secure Conversation.
WCF allows you to send messages over TCP, named pipes, or MSMQ. These messages
can be encoded as text or using an optimized binary format. Binary data can be sent
efficiently using the MTOM standard. If none of the provided transports or encodings
suit your needs you can create your own custom transport or encoding.
Durable Messages
A durable message is one that is never lost due to a disruption in the communication.
The messages in a durable message pattern are always saved to a database. If a
disruption occurs, the database allows you to resume the message exchange when the
connection is restored. You can also create a durable message using the Windows
Workflow Foundation (WF).
Transactions
WCF also supports transactions using one of three transaction models: WS-Atomic
Ttransactions, the APIs in the System.Transactions namespace, and Microsoft
Distributed Transaction Coordinator.
Extensibility
The WCF architecture has a number of extensibility points. If extra capability is required,
there are a number of entry points that allow you to customize the behavior of a
service.