Windows Presentation Foundation (WPF) is a graphical subsystem by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.
WPF employs XAML, an XML-based language, to define and link various interface elements. WPF applications can be deployed as standalone desktop programs or hosted as an embedded object in a website. WPF aims to unify a number of common user interface elements, such as 2D/3D rendering, fixed and adaptive documents, typography, vector graphics, runtime animation, and pre-rendered media. These elements can then be linked and manipulated based on various events, user interactions, and data bindings.
WPF runtime libraries are included with all versions of Microsoft Windows since Windows Vista and Windows Server 2008. Users of Windows XP SP2/SP3 and Windows Server 2003 can optionally install the necessary libraries.
Microsoft Silverlight provided functionality that is mostly a subset of WPF to provide embedded web controls comparable to Adobe Flash. 3D runtime rendering had been supported in Silverlight since Silverlight 5.
At the Microsoft Connect event on December 4, 2018, Microsoft announced releasing WPF as open source project on GitHub. It is released under the MIT License. Windows Presentation Foundation has become available for projects targeting the .NET Core framework, however, the system is not cross-platform and is still available only on Windows.
Graphics, including desktop items like windows, are rendered using Direct3D. This allows the display of more complex graphics and custom themes, at the cost of GDI's wider range of support and uniform control theming. It allows Windows to offload some graphics tasks to the GPU. This reduces the workload on the computer's CPU. GPUs are optimized for parallel pixel computations. This tends to speed up screen refreshes at the cost of decreased compatibility in markets where GPUs are not necessarily as powerful, such as the netbook market.
The Windows Presentation Foundation (WPF) is Microsoft's UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher. WPF's emphasis on vector graphics allows most controls and elements to be scaled without loss in quality or pixelization, thus increasing accessibility. With the exception of Silverlight, Direct3D integration allows for streamlined 3D rendering. In addition, interactive 2D content can be overlaid on 3D surfaces natively.
DocumentViewerclass, which is for reading fixed layout documents. The
FlowDocumentReaderclass offers different view modes such as per-page or scrollable and also reflows text if the viewing area is resized.
To enable the use of WinForms, the developer executes this from their WPF C# code:
Following the success of markup languages for web development, WPF introduces eXtensible Application Markup Language (XAML; /ˈzæməl/), which is based on XML. XAML is designed as a more efficient method of developing application user interfaces.
The specific advantage that XAML brings to WPF is that XAML is a completely declarative language, allowing the developer (or designer) to describe the behavior and integration of components without the use of procedural programming. Although it is rare that an entire application will be built completely in XAML, the introduction of XAML allows application designers to more effectively contribute to the application development cycle. Using XAML to develop user interfaces also allows for separation of model and view, which is considered a good architectural principle. In XAML, elements and attributes map to classes and properties in the underlying APIs.
As in web development, both layouts and specific themes are well suited to markup, but XAML is not required for either. Indeed, all elements of WPF may be coded in a .NET language (C#, VB.NET). The XAML code can ultimately be compiled into a managed assembly in the same way all .NET languages are.
The architecture of WPF spans both managed code and native code components. However, the public API exposed is only available via managed code. While the majority of WPF is in managed code, the composition engine which renders the WPF applications is a native component. It is named Media Integration Layer (MIL) and resides in
milcore.dll. It interfaces directly with DirectX and provides basic support for 2D and 3D surfaces, timer-controlled manipulation of contents of a surface with a view to exposing animation constructs at a higher level, and compositing the individual elements of a WPF application into a final 3D "scene" that represents the UI of the application and renders it to the screen. The Desktop Window Manager also uses the MIL for desktop and window composition. The media codecs are also implemented in unmanaged code, and are shipped as
windowscodecs.dll. In the managed world, PresentationCore (
presentationcore.dll) provides a managed wrapper for MIL and implements the core services for WPF, including a property system that is aware of the dependencies between the setters and consumers of the property, a message dispatching system by means of a
Dispatcher object to implement a specialized event system and services which can implement a layout system such as measurement for UI elements. PresentationFramework (
presentationframework.dll) implements the end-user presentational features, including layouts, time-dependent, story-board based animations, and data binding.
WPF exposes a property system for objects which inherit from
DependencyObject, that is aware of the dependencies between the consumers of the property, and can trigger actions based on changes in properties. Properties can be either hard coded values or expressions, which are specific expressions that evaluate to a result. In the initial release, however, the set of expressions supported is closed. The value of the properties can be inherited from parent objects as well. WPF properties support change notifications, which invoke bound behaviors whenever some property of some element is changed. Custom behaviors can be used to propagate a property change notification across a set of WPF objects. This is used by the layout system to trigger a recalculation of the layout on property-changes, thus exposing a declarative programming style for WPF, whereby almost everything, from setting colors and positions to animating elements can be achieved by setting properties. This allows WPF applications to be written in XAML, which is a declarative mark-up language, by binding the keywords and attributes directly to WPF classes and properties.
The interface elements of a WPF application are maintained as a class of
Visual objects. Visual objects provide a managed interface to a composition tree which is maintained by Media Integration Layer (MIL). Each element of WPF creates and adds one or more composition nodes to the tree. The composition nodes contain rendering instructions, such as clipping and transformation instructions, along with other visual attributes. Thus the entire application is represented as a collection of composition nodes, which are stored in a buffer in the system memory. Periodically, MIL walks the tree and executes the rendering instructions in each node, thus compositing each element on to a DirectX surface, which is then rendered on screen. MIL uses the painter's algorithm, where all the components are rendered from back of the screen to the front, which allows complex effects like transparencies to be easily achieved. This rendering process is hardware accelerated using the GPU. The composition tree is cached by MIL, creating a retained mode graphics, so that any changes to the composition tree needs only to be incrementally communicated to MIL. This also frees the applications of managing repainting the screen; MIL can do that itself as it has all the information necessary. Animations can be implemented as time-triggered changes to the composition tree. On the user visible side, animations are specified declaratively, by setting some animation effect to some element via a property and specifying the duration. The code-behind updates the specific nodes of the tree, via
Visual objects, to represent both the intermediate states at specified time intervals as well as the final state of the element. MIL will render the changes to the element automatically.
All WPF applications start with two threads: one for managing the UI and another background thread for handling rendering and repainting. Rendering and repainting is managed by WPF itself, without any developer intervention. The UI thread houses the Dispatcher (via an instance of
DispatcherObject), which maintains a queue of UI operations that need to be performed (as a tree of
Visual objects), sorted by priority. UI events, including changing a property that affects the layout, and user interaction events raised are queued up in the dispatcher, which invokes the handlers for the events. Microsoft recommends that the event handlers only update the properties to reflect new content for application responsiveness, with the new content being generated or retrieved in a background thread. The render thread picks up a copy of the visual tree and walks the tree calculating which components will be visible and renders them to Direct3D surfaces. The render thread also caches the visual tree, so only changes to the tree need to be communicated, which will result in updating just the changed pixels. WPF supports an extensible layout model. Layout is divided into two phases: Measure; and Arrange. The Measure phase recursively calls all elements and determines the size they will take. In the Arrange phase, the child elements are recursively arranged by their parents, invoking the layout algorithm of the layout module in use.
A number of development tools are available for developing Windows Presentation Foundation applications.
WPF's deployment model offers both standalone and XAML Browser Applications (XBAP, pronounced "ex-bap") flavors. The programming model for building either type of application is similar.
Standalone applications are those that have been locally installed on the computer using software such as ClickOnce or Windows Installer (MSI) and which run on the desktop. Standalone applications are considered full trust and have full access to a computer's resources.
XAML Browser Applications (XBAPs) are programs that are hosted inside a web browser. Pre-.NET4 XBAP applications run in a partial trust sandbox environment, and are not given full access to the computer's resources and not all WPF functionality is available. The hosted environment is intended to protect the computer from malicious applications. XBAPs can run as fully trusted applications in .NET 4, with full access to computer resources. Starting an XBAP from an HTML page or vice versa is seamless (there is no security or installation prompt). Although one gets the perception of the application running in the browser, it actually runs in an out-of-process executable different from the browser.
As of the release of .NET Framework 3.0, XBAPs would only run in IE.
With the release of .NET Framework 3.5 SP1, XBAP also runs in Mozilla Firefox using the included extension. On October 16, 2009, Mozilla added the Firefox plugin and extension to its add-ons blocklist, because of a remotely exploitable serious security vulnerability, in agreement with Microsoft. Two days later, the block was removed. On Windows 7, the Firefox plugin does not run by default. A reinstallation of the .NET Framework 3.5 SP1 will install the plugin and add support for XBAP applications on Firefox. Alternatively, hard-copying the plugin DLLs from a working Windows XP/Vista installation to the plugin directory of Mozilla Firefox will also reinstate support for XBAP applications. The WPF plugin DLLs reside in the following directories (depending on the Framework version):
Silverlight (codenamed WPF/E) is a deprecated cross-browser browser plugin which contained WPF-based technology (including XAML) that provided features such as video, vector graphics, and animations to multiple operating systems including Windows 7, Windows Vista, Windows XP, and Mac OS X. Microsoft sanctioned a limited number of 3rd party developers to work on ports for certain Linux distributions. Specifically, it was provided as an add-on for Mozilla Firefox, Internet Explorer 6 and above, Google Chrome 42 and below and Apple Safari.
The .NET Micro Framework includes a GUI object model loosely based on WPF, although without support for XAML.
The Accelerator is a collection of development solutions for IBM i and Windows platforms using .NET Framework, and/or LANSA, technologies provided by Surround Technologies. The Accelerator development architecture is a tool for building Windows and Web apps within a structured framework.The intent of the Accelerator solutions is to provide a rapid application development (RAD) environment, that produces well-designed n-tier code that can run in a client/server, web or mobile deployment. The use of Microsoft’s .NET Framework, is recommended by Surround for zero-lock in development and optimal deployment flexibility including both Windows Presentation Foundation (WPF) and responsive web (and mobile) design (ASP.NET MVC / Bootstrap) clients.The Accelerator uses customizable templates, standards and naming conventions to generate code. The generated code is human readable, and standardized to minimize testing, debugging, customization, and future maintenance efforts. The generated code follows object-oriented programming design principles, the inversion of control (IoC) pattern, observer pattern, model–view–viewmodel (MVVM, with OO techniques to avoid redundancy, promote ease of testing and maintenance). Supports ASP.NET MVC3 Framework. Other patterns followed by the architecture, or are adapted depending on the case; flexibility promoted by the typical use of abstraction patterns when practical. Abstraction is promoted though the use of Windows Presentation Foundation and Windows Communication Foundation.ClearType
ClearType is Microsoft's implementation of subpixel rendering technology in rendering text in a font system. ClearType attempts to improve the appearance of text on certain types of computer display screens by sacrificing color fidelity for additional intensity variation. This trade-off is asserted to work well on LCD flat panel monitors.
ClearType was first announced at the November 1998 COMDEX exhibition. The technology was first introduced in software in January 2000 as an always-on feature of Microsoft Reader, which was released to the public in August 2000.
ClearType was significantly changed with the introduction of DirectWrite in Windows 7.Word 2013 stopped using ClearType, because "There is a problem with ClearType: it depends critically on the color of the background pixels."ClickOnce
ClickOnce is a component of Microsoft .NET Framework 2.0 and later, and supports deploying applications made with Windows Forms or Windows Presentation Foundation. It is similar to Java Web Start for the Java Platform or Zero Install for Linux.Extensible Application Markup Language
Extensible Application Markup Language (XAML (listen)) is a declarative XML-based language developed by Microsoft that is used for initializing structured values and objects. It is available under Microsoft's Open Specification Promise. The acronym originally stood for Extensible Avalon Markup Language, Avalon being the code-name for Windows Presentation Foundation (WPF).XAML is used extensively in .NET Framework 3.0 & .NET Framework 4.0 technologies, particularly Windows Presentation Foundation (WPF), Silverlight, Windows Workflow Foundation (WF), Windows Runtime XAML Framework and Windows Store apps. In WPF, XAML forms a user interface markup language to define UI elements, data binding, events, and other features. In WF, workflows can be defined using XAML. XAML can also be used in Silverlight applications, Windows Phone apps and Windows Store apps.
XAML elements map directly to Common Language Runtime object instances, while XAML attributes map to Common Language Runtime properties and events on those objects. XAML files can be created and edited with visual design tools like Microsoft Expression Blend, Microsoft Visual Studio, and the hostable Windows Workflow Foundation visual designer. They can also be created and edited with a standard text editor, a code editor like XAMLPad, or a graphical editor like Vector Architect.
Anything that is created or implemented in XAML can be expressed using a more traditional .NET language, such as C# or Visual Basic .NET. However, a key aspect of the technology is the reduced complexity needed for tools to process XAML, because it is based on XML. Consequently, a variety of products are emerging, particularly in the WPF space, which create XAML-based applications. As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation. XAML also benefits from being a declarative definition of the UI rather than procedural code to generate it.Family.Show
Family.Show is a free genealogy program, created as a reference sample for Microsoft's Windows Presentation Foundation.Graphical user interface builder
A graphical user interface builder (or GUI builder), also known as GUI designer, is a software development tool that simplifies the creation of GUIs by allowing the designer to arrange graphical control elements (often called widgets) using a drag-and-drop WYSIWYG editor. Without a GUI builder, a GUI must be built by manually specifying each widget's parameters in source-code, with no visual feedback until the program is run.
User interfaces are commonly programmed using an event-driven architecture, so GUI builders also simplify creating event-driven code. This supporting code connects widgets with the outgoing and incoming events that trigger the functions providing the application logic.
Some graphical user interface builders, such as e.g. Glade Interface Designer, automatically generate all the source code for a graphical control element. Others, like Interface Builder, generate serialized object instances that are then loaded by the application.Infragistics
Infragistics is a global software company, founded in 1989, that publishes user interface (UI) development tools and components for a range of developer applications, across all platforms. The company is also a provider of developer support, testing tools, and UI and User Experience (UX) training and consulting services.Their products enable developers to create UIs that are the foundation for developing applications with data visualization in line of business applications for platforms that include —Windows Forms, Windows Presentation Foundation (WPF), ASP.NET and Silverlight as well as jQuery/HTML5, and mobile controls for the Windows Phone, iOS (iPhone and iPad) and Android.
Infragistics branched into the application prototyping industry with Indigo Studio, which is aimed at injecting simple design principles into the software development process. Additionally, in 2012 Infragistics acquired mobile app development company, Southlabs and continues to develop their Enterprise Mobility products, SharePlus (a mobile sharepoint client) and ReportPlus (a mobile dashboarding application).
The company, based in Cranbury, NJ, was established in November 2000 when ProtoView Development Corporation and Sheridan Software Systems, Inc. merged. Besides its U.S. headquarters in New Jersey, Infragistics has offices in eight other countries including the UK, Germany, Australia, France, Japan, India, Bulgaria and Uruguay.Live Connect
Live Connect (previously Messenger Connect, Live Services and Windows Live Dev) is a collection of APIs and common controls that allow developers to have a deeper control and offers access to the core Windows Live services and data through open and easily accessible application programming interfaces (APIs). At MIX07, Microsoft's Senior Architect Danny Thorpe described:
Magnifier, formerly Microsoft Magnifier, is a screen magnifier app intended for visually impaired people to use when running Microsoft Windows. When it is running, it creates a bar at the top of the screen that greatly magnifies where the mouse is. Magnifier was first included as a sample in the Active Accessibility SDK/RDK for Windows 95 and later made a standard Windows utility starting with Windows 98. Prior to Windows Vista, Magnifier could be used to magnify the screen up to 9 times its normal size. Windows Vista and later allow up to 16× magnification.
In Windows Vista, Magnifier uses WPF, which in turn uses vector images to render the content. As a result, the rendered magnified image is sharp and not pixelated. However, this is useful only for Windows Presentation Foundation applications. Non-WPF applications are still magnified the traditional way. Also, due to a change introduced in WPF 3.5 SP1, this functionality is lost if .NET Framework 3.5 SP1 is installed.Microsoft has also released a Magnification API to allow assistive technology applications to use the Magnifier engine.Microsoft's Windows 7 operating system includes a significantly improved version of Magnifier. It features full-screen magnification which allows a user to pan around the screen at up to 16× magnification.
However, the full screen feature has also been criticized due to its incompatibility with the high contrast color schemes found in the Windows 7 beta release. This issue remains in the final Windows 7 release. Besides this, when the magnifier zooms, the text will appear blurry or pixelated because it is not being directly rendered at the larger size; instead, the smaller sized rendering is being enlarged as a raster image. ClearType sub-pixel anti-aliasing is also magnified as a result of this, so if ClearType is active, the magnified text may appear to have unexpected colors at the edges of non-horizontal lines. Some third party magnification software compensates for this effect by applying scaling filters to the enlarged image.
The magnifier also features a lens mode similar to that found in the existing version of the software. Lens mode is improved, however, as now the magnifying window will follow the cursor around the screen rather than remain in a fixed position. Finally the magnifier is much easier to access by using the Windows key and +/- to control the zoom level without the need to start the application first. Pressing the Win+Esc combination will exit the magnifier.Microsoft Blend
Microsoft Blend for Visual Studio (formerly Microsoft Expression Blend) is a user interface design tool developed and sold by Microsoft for creating graphical interfaces for web and desktop applications that blend the features of these two types of applications. It is an interactive, WYSIWYG front-end for designing XAML-based interfaces for Windows Presentation Foundation, Silverlight and UWP applications. It was one of the applications in the Microsoft Expression Studio suite before that suite was discontinued.
Expression Blend supports the WPF text engine with advanced OpenType typography and ClearType, vector-based 2D widgets, and 3D widgets with hardware acceleration via DirectX.Microsoft Silverlight
Microsoft Silverlight (or simply Silverlight) is a deprecated application framework for writing and running rich Internet applications, similar to Adobe Flash. A plugin for Silverlight is still available for some browsers. While early versions of Silverlight focused on streaming media, later versions supported multimedia, graphics, and animation and gave developers support for CLI languages and development tools. Silverlight was also one of the two application development platforms for Windows Phone, but web pages that use Silverlight did not run on the Windows Phone or Windows Mobile versions of Internet Explorer, as there was no Silverlight plugin for Internet Explorer on those platforms.Model–view–viewmodel
Model–view–viewmodel (MVVM) is a software architectural pattern.
MVVM facilitates a separation of development of the graphical user interface – be it via a markup language or GUI code – from development of the business logic or back-end logic (the data model). The view model of MVVM is a value converter, meaning the view model is responsible for exposing (converting) the data objects from the model in such a way that objects are easily managed and presented. In this respect, the view model is more model than view, and handles most if not all of the view's display logic. The view model may implement a mediator pattern, organizing access to the back-end logic around the set of use cases supported by the view.
MVVM is a variation of Martin Fowler's Presentation Model design pattern. MVVM abstracts a view's state and behavior in the same way, but a Presentation Model abstracts a view (creates a view model) in a manner not dependent on a specific user-interface platform.
The Multiuse-Model View (MMV) is an architectural pattern used in software engineering that came about as an enhancement to the MVVM design pattern. The pattern is specific for Windows Presentation Foundation (WPF) and Windows Communication Foundation (WCF) applications. While keeping the logical separation of user interface (View) versus logic (Model), MMV's primary objective is to address the shortcomings of the MVVM pattern. The Multiuse-Model of MMV typically relies on reflection to facilitate object building in order to easily integrate logic-centric object models with view-centric object models minimizing the amount of duplicate code. MMV was designed to make use of specific functions in C#, WPF and WCF to better facilitate the reuse of code between the server and the client.Reflowable document
A reflowable document is a type of electronic document that can adapt its presentation to the output device. Typical prepress or fixed page size output formats like PostScript or PDF are not reflowable during the actual printing process because the page is not resized. For end users, the World Wide Web standard, HTML is a reflowable format as is the case with any resizable electronic page format.
In contrast to end user terminology, the notion of reflow is sometimes used to discuss desktop publishing program features for print publication page layout such as automatically balancing the amount of text in a number of columns.Widget (GUI)
A control element (sometimes called a control or widget) in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, GTK+, and Cocoa, contain a collection of controls and the logic to render these.Each widget facilitates a specific type of user-computer interaction, and appears as a visible part of the application's GUI as defined by the theme and rendered by the rendering engine. The theme makes all widgets adhere to a unified aesthetic design and creates a sense of overall cohesion. Some widgets support interaction with the user, for example labels, buttons, and check boxes. Others act as containers that group the widgets added to them, for example windows, panels, and tabs.
Structuring a user interface with widget toolkits allows developers to reuse code for similar tasks, and provides users with a common language for interaction, maintaining consistency throughout the whole information system.
Graphical user interface builders facilitate the authoring of GUIs in a WYSIWYG manner employing a user interface markup language. They automatically generate all the source code for a widget from general descriptions provided by the developer, usually through direct manipulation.Windows Imaging Component
Windows Imaging Component (WIC) is a Component Object Model based imaging codec framework introduced in Windows Vista (and later available in Windows XP Service Pack 3) for working with and processing digital images and image metadata. It allows applications supporting the framework to automatically get support of installed codecs for graphics file formats.
It is similar to DirectShow, or ACM/VCM, in that it can be extended using image codecs and can support third-party graphics formats on a system-wide basis. Additionally, Windows Presentation Foundation applications also automatically support the installed image codecs. Codecs for RAW image formats used by high-end professional digital cameras are also supported in this manner.
WIC enables application developers to perform image processing operations on any image format through a single set of common APIs, without requiring prior knowledge of specific image formats. By writing a codec once for WIC, developers can get system-wide support for that graphics file format in all applications that use WIC, .NET 3.x or WPF.Windows Live TV
Windows Live for TV (codenamed Orbit, previously Nemo) is a Windows Media Center application that was part of Microsoft's Windows Live services. It provides users to access Windows Live Spaces, Messenger, and Call on their large-screen monitors or TVs using their PC.
The goal of Windows Live for TV was to bring social networking to a new form factor that is both intuitive and fun to use. The application is built using Windows Presentation Foundation (.NET Framework 3.0) and runs within Windows Media Center or directly in Windows Vista's Internet Explorer 7.0 browser.
Planned features of Windows Live for TV included:
Browse Windows Live Spaces in 3D graphics with new "Gallery" views and full keyword search
Real-time text and voice conversations with Windows Live Messenger
Call your friends' mobile or landline telephones with Windows Live Call to make affordable domestic and international calls
Make free PC-to-PC calls to other Windows Live Messenger users
Easily navigate with a mouse, keyboard or a TV remote (remote navigation requires Windows Media Center Remote and Infrared Adapter)Although beta versions of this service have been released, only Spaces functionality is available. A Program Manager has stated that development has ceased, and the service will be shut down on June 24, 2008. The Windows Live for TV team blog has not been updated for a year, while the WPF/XBAP technology used in Windows Live for TV was deprecated by Microsoft in Windows Media Center SDK 5.3.Witty (software)
Witty is a free Twitter client for Microsoft Windows released under the open source New BSD License and powered by the Windows Presentation Foundation. Witty was developed with Microsoft Visual Studio 2008 and Expression Blend.XAML Browser Applications
XAML Browser Applications (XBAP, pronounced "ex-bap") are Windows Presentation Foundation (.xbap) applications that are hosted and run inside a web browser such as Firefox or Internet Explorer. Hosted applications run in a partial trust sandbox environment and are not given full access to the computer's resources like opening a new network connection or saving a file to the computer disk and not all WPF functionality is available. The hosted environment is intended to protect the computer from malicious applications; however it can also run in full trust mode by the client changing the permission. Starting an XBAP from an HTML page is seamless (with no security or installation prompt). Although one perceives the application running in the browser, it actually runs in an out-of-process executable (PresentationHost.exe) managed by a virtual machine. In the initial release of .NET Framework 3.0, XBAPs only ran in Internet Explorer. With the release of .NET Framework 3.5 SP1, which includes an XBAP extension, they also run in Mozilla Firefox.
|Text and multilingual|