PresentationFramework 4.6.0

  • Package Manager
  • PackageReference
  • Script & Interactive
  • Dependencies

PresentationFramework

Compatible and additional computed target framework versions.
.NET Framework net net is compatible. 

This package has no dependencies.

NuGet packages (12)

Showing the top 5 NuGet packages that depend on PresentationFramework:

Package Downloads

Logging for TEPS Utilities

Trello logging for TEPS Utilities

Amazon SQS interaction for TEPS Utilities

Pattern implementation MVVM with Frame for WPF

This library is designed to simplify testing applications created using the library MvvmFrame.Wpf

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on PresentationFramework:

Repository Stars
Version Downloads Last updated
406,795 8/25/2017

C# Corner

  • TECHNOLOGIES
  • An Interview Question

WPF

An Overview Of WPF Architecture

presentationframework.dll c#

  • Aug 17, 2017
  • Other Artcile

In continuation of my previous article ABCs of WPF, I am going to discuss the architecture of WPF.

In continuation of my previous article “ ABCs of WP F ”, I am going to discuss the architecture of WPF. There is architecture behind every language. We are not going in depth to understand each and every thing. I suggest you to go through the basics of WPF by your own created samples. It would help you understand the each layer of WPF in detail.

The architecture of WPF can be classified into three layers,

Managed Layer

Unmanaged Layer

Core API Layer

presentationframework.dll c#

(Image is taken from Google)

This layer contains Presentation Framework and the Presentation Core, which is basically part of .Net framework and written in managed code, hence called managed layer. All the managed code management is managed by CLR itself. Basically, three DLL files -PresentationFramework.dll, PresentationCode.dll, and WindowsBase.dll build the make part of WPF Architecture.

presentationframework.dll c#

PresentationFramework.dll This DLL consists of all classes that are required to create the WPF UI. This wraps up the controls, data bindings, styling, shapes, media, documents, annotations, animation and more.

On exploring

presentationframework.dll c#

PresentationCore . dll Presentation Core acts as a managed wrapper around MILCore and provides a public interface for MIL. This is a low-level API exposed by WPF providing features for 2D, 3D, geometry and so on. Presentation Core provides classes for creating application visual tree. The Visual System creates a visual tree which contains applications Visual Elements and rendering instructions. PresentationCore.dll is responsible for this purpose.

presentationframework.dll c#

WindowsBase.dll WindowsBase.dll assembly holds the most basic and most important types in WPF like DependencyObject, DependencyProperty, DispatcherObject and DispatcherTimer.

These classes are the base of WPF. The main classes exist in System.Windows namespace and System.Windows.Threading namespaces.

presentationframework.dll c#

This layer has two segments.

  • WindowsCodecs

This layer is also called MilCore (Media Integration Library).

MilCore (Media Integration Library) Milcore is a part of the unmanaged code which allows tight integration with DirectX (responsible for display and rendering). All rendering of controls in WPF is done through DirectX engine. DirectX is a collection of API developed by Microsoft for graphics, 2D, 3D programs.

WindowsCodecs WindowsCodecs provides Imaging support in WPF. Image display, processing, scaling and transform are all handled by WindowsCodecs

This layer has OS core components like Kernel, User32, GDI, Device Drivers, Graphic cards etc. These components are used by the application to access low-level APIs. User32 manages memory and process separation.

  • DirectX DirectX is the low-level API through which WPF renders all graphics. DirectX talks with drivers and renders the content.
  • User32 User32 actually manages memory and process separation. It is the primary core API that every application uses. User32 decides which element will be placed where on the screen.
  • GDI GDI stands for Graphic Device Interface. GDI provides an expanded set of graphics primitives and a number of improvements in rendering quality.
  • CLR WPF leverages the full .NET Framework and executes on the Common Language Runtime (CLR).
  • Device Drivers Device Drivers are specific to the operating system. Device Drivers are used by the applications to access low-level APIs.
  • WPF Architecture

C# Corner Ebook

WPF Simplified: Build Windows Apps Using C# and XAML

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Desktop Guide (WPF .NET)

  • 5 contributors

Welcome to the Desktop Guide for Windows Presentation Foundation (WPF), a UI framework that is resolution-independent and uses a vector-based rendering engine, built to take advantage of modern graphics hardware. WPF provides a comprehensive set of application-development features that include Extensible Application Markup Language (XAML), controls, data binding, layout, 2D and 3D graphics, animation, styles, templates, documents, media, text, and typography. WPF is part of .NET, so you can build applications that incorporate other elements of the .NET API.

There are two implementations of WPF:

.NET version (this guide):

An open-source implementation of WPF hosted on GitHub , which runs on .NET. The XAML designer requires, at a minimum, Visual Studio 2019 version 16.8 . But depending on your version of .NET, you may be required to use a newer version of Visual Studio.

Even though .NET is a cross-platform technology, WPF only runs on Windows.

.NET Framework 4 version:

The .NET Framework implementation of WPF that's supported by Visual Studio 2019 and Visual Studio 2017.

.NET Framework 4 is a Windows-only version of .NET and is considered a Windows Operating System component. This version of WPF is distributed with .NET Framework. For more information about the .NET Framework version of WPF, see Introduction to WPF for .NET Framework .

This overview is intended for newcomers and covers the key capabilities and concepts of WPF. To learn how to create a WPF app, see Tutorial: Create a new WPF app .

Why upgrade from .NET Framework

When you are upgrading your application from .NET Framework to .NET, you will benefit from:

  • Better performance
  • New .NET APIs
  • The latest language improvements
  • Improved accessibility and reliability
  • Updated tooling and more

To learn how to upgrade your application, see How to upgrade a WPF desktop app to .NET 7 .

Program with WPF

WPF exists as a subset of .NET types that are, mostly located in the System.Windows namespace. If you have previously built applications with .NET with frameworks like ASP.NET and Windows Forms, the fundamental WPF programming experience should be familiar, you:

  • Instantiate classes
  • Set properties
  • Call methods
  • Handle events

WPF includes more programming constructs that enhance properties and events: dependency properties and routed events .

Markup and code-behind

WPF lets you develop an application using both markup and code-behind , an experience with which ASP.NET developers should be familiar. You generally use XAML markup to implement the appearance of an application while using managed programming languages (code-behind) to implement its behavior. This separation of appearance and behavior has the following benefits:

Development and maintenance costs are reduced because appearance-specific markup isn't tightly coupled with behavior-specific code.

Development is more efficient because designers can implement an application's appearance simultaneously with developers who are implementing the application's behavior.

Globalization and localization for WPF applications is simplified.

XAML is an XML-based markup language that implements an application's appearance declaratively. You typically use it to define windows, dialog boxes, pages, and user controls, and to fill them with controls, shapes, and graphics.

The following example uses XAML to implement the appearance of a window that contains a single button:

Specifically, this XAML defines a window and a button by using the Window and Button elements. Each element is configured with attributes, such as the Window element's Title attribute to specify the window's title-bar text. At run time, WPF converts the elements and attributes that are defined in markup to instances of WPF classes. For example, the Window element is converted to an instance of the Window class whose Title property is the value of the Title attribute.

The following figure shows the user interface (UI) that is defined by the XAML in the previous example:

A window that contains a button

Since XAML is XML-based, the UI that you compose with it's assembled in a hierarchy of nested elements that is known as an element tree . The element tree provides a logical and intuitive way to create and manage UIs.

Code-behind

The main behavior of an application is to implement the functionality that responds to user interactions. For example clicking a menu or button, and calling business logic and data access logic in response. In WPF, this behavior is implemented in code that is associated with markup. This type of code is known as code-behind. The following example shows the updated markup from the previous example and the code-behind:

The updated markup defines the xmlns:x namespace and maps it to the schema that adds support for the code-behind types. The x:Class attribute is used to associate a code-behind class to this specific XAML markup. Considering this attribute is declared on the <Window> element, the code-behind class must inherit from the Window class.

InitializeComponent is called from the code-behind class's constructor to merge the UI that is defined in markup with the code-behind class. ( InitializeComponent is generated for you when your application is built, which is why you don't need to implement it manually.) The combination of x:Class and InitializeComponent ensure that your implementation is correctly initialized whenever it's created.

Notice that in the markup the <Button> element defined a value of button_Click for the Click attribute. With the markup and code-behind initialized and working together, the Click event for the button is automatically mapped to the button_Click method. When the button is clicked, the event handler is invoked and a message box is displayed by calling the System.Windows.MessageBox.Show method.

The following figure shows the result when the button is clicked:

A MessageBox

Input and commands

Controls most often detect and respond to user input. The WPF input system uses both direct and routed events to support text input, focus management, and mouse positioning.

Applications often have complex input requirements. WPF provides a command system that separates user-input actions from the code that responds to those actions. The command system allows for multiple sources to invoke the same command logic. For example, take the common editing operations used by different applications: Copy , Cut , and Paste . These operations can be invoked by using different user actions if they're implemented by using commands.

The user experiences that are delivered by the application model are constructed controls. In WPF, control is an umbrella term that applies to a category of WPF classes that have the following characteristics:

  • Hosted in either a window or a page.
  • Have a user interface.
  • Implement some behavior.

For more information, see Controls .

WPF controls by function

The built-in WPF controls are listed here:

Buttons : Button and RepeatButton .

Data Display : DataGrid , ListView , and TreeView .

Date Display and Selection : Calendar and DatePicker .

Dialog Boxes : OpenFileDialog , PrintDialog , and SaveFileDialog .

Digital Ink : InkCanvas and InkPresenter .

Documents : DocumentViewer , FlowDocumentPageViewer , FlowDocumentReader , FlowDocumentScrollViewer , and StickyNoteControl .

Input : TextBox , RichTextBox , and PasswordBox .

Layout : Border , BulletDecorator , Canvas , DockPanel , Expander , Grid , GridView , GridSplitter , GroupBox , Panel , ResizeGrip , Separator , ScrollBar , ScrollViewer , StackPanel , Thumb , Viewbox , VirtualizingStackPanel , Window , and WrapPanel .

Media : Image , MediaElement , and SoundPlayerAction .

Menus : ContextMenu , Menu , and ToolBar .

Navigation : Frame , Hyperlink , Page , NavigationWindow , and TabControl .

Selection : CheckBox , ComboBox , ListBox , RadioButton , and Slider .

User Information : AccessText , Label , Popup , ProgressBar , StatusBar , TextBlock , and ToolTip .

When you create a user interface, you arrange your controls by location and size to form a layout. A key requirement of any layout is to adapt to changes in window size and display settings. Rather than forcing you to write the code to adapt a layout in these circumstances, WPF provides a first-class, extensible layout system for you.

The cornerstone of the layout system is relative positioning, which increases the ability to adapt to changing window and display conditions. The layout system also manages the negotiation between controls to determine the layout. The negotiation is a two-step process: first, a control tells its parent what location and size it requires. Second, the parent tells the control what space it can have.

The layout system is exposed to child controls through base WPF classes. For common layouts such as grids, stacking, and docking, WPF includes several layout controls:

Canvas : Child controls provide their own layout.

DockPanel : Child controls are aligned to the edges of the panel.

Grid : Child controls are positioned by rows and columns.

StackPanel : Child controls are stacked either vertically or horizontally.

VirtualizingStackPanel : Child controls are virtualized and arranged on a single line that is either horizontally or vertically oriented.

WrapPanel : Child controls are positioned in left-to-right order and wrapped to the next line when there isn't enough space on the current line.

The following example uses a DockPanel to lay out several TextBox controls:

The DockPanel allows the child TextBox controls to tell it how to arrange them. To do this, the DockPanel implements a Dock attached property that is exposed to the child controls to allow each of them to specify a dock style.

A property that's implemented by a parent control for use by child controls is a WPF construct called an attached property .

The following figure shows the result of the XAML markup in the preceding example:

DockPanel page

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 many different .NET data access libraries such as SQL and Entity Framework Core. After the data is accessed and loaded into an application's managed objects, the hard work for WPF applications begins. Essentially, this involves two things:

Copying the data from the managed objects into controls, where the data can be displayed and edited.

Ensuring that changes made to data by using controls are copied back to the managed objects.

To simplify application development, WPF provides a powerful data binding engine to automatically handle these steps. The core unit of the data binding engine is the Binding class, whose job is to bind a control (the binding target) to a data object (the binding source). This relationship is illustrated by the following figure:

Basic data binding diagram

WPF supports declaring bindings in the XAML markup directly. For example, the following XAML code binds the Text property of the TextBox to the Name property of an object using the " {Binding ... } " XAML syntax. This assumes there's a data object set to the DataContext property of the Window with a Name property.

The WPF data binding engine provides more than just binding, it provides validation, sorting, filtering, and grouping. Furthermore, data binding supports the use of data templates to create custom user interface for bound data.

For more information, see Data binding overview .

Graphics & animation

WPF provides an extensive and flexible set of graphics features that have the following benefits:

Resolution-independent and device-independent graphics . The basic unit of measurement in the WPF graphics system is the device-independent pixel, which is 1/96th of an inch, and provides the foundation for resolution-independent and device-independent rendering. Each device-independent pixel automatically scales to match the dots-per-inch (dpi) setting of the system it renders on.

Improved precision . The WPF coordinate system is measured with double-precision floating-point numbers rather than single-precision. Transformations and opacity values are also expressed as double-precision. WPF also supports a wide color gamut (scRGB) and provides integrated support for managing inputs from different color spaces.

Advanced graphics and animation support . WPF simplifies graphics programming by managing animation scenes for you; there's no need to worry about scene processing, rendering loops, and bilinear interpolation. Additionally, WPF provides hit-testing support and full alpha-compositing support.

Hardware acceleration . The WPF graphics system takes advantage of graphics hardware to minimize CPU usage.

2D graphics

WPF provides a library of common vector-drawn 2D shapes, such as the rectangles and ellipses. The shapes aren't just for display; shapes implement many of the features that you expect from controls, including keyboard and mouse input.

The 2D shapes provided by WPF cover the standard set of basic shapes. However, you may need to create custom shapes to help the design of a customized user interface. WPF provides geometries to create a custom shape that can be drawn directly, used as a brush, or used to clip other shapes and controls.

For more information, see Geometry overview .

A subset of WPF 2D capabilities includes visual effects, such as gradients, bitmaps, drawings, painting with videos, rotation, scaling, and skewing. These effects are all achieved with brushes. The following figure shows some examples:

Illustration of different brushes

For more information, see WPF brushes overview .

3D rendering

WPF also includes 3D rendering capabilities that integrate with 2D graphics to allow the creation of more exciting and interesting user interfaces. For example, the following figure shows 2D images rendered onto 3D shapes:

Visual3D sample screen shot

For more information, see 3D graphics overview .

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. The following figure shows a simple animation in action:

For more information, see Animation overview .

Text and typography

To provide high-quality text rendering, WPF offers the following features:

  • OpenType font support.
  • ClearType enhancements.
  • High performance that takes advantage of hardware acceleration.
  • Integration of text with media, graphics, and animation.
  • International font support and fallback mechanisms.

As a demonstration of text integration with graphics, the following figure shows the application of text decorations:

Text with various text decorations

For more information, see Typography in Windows Presentation Foundation .

Customize WPF apps

Up to this point, you've seen the core WPF building blocks for developing applications:

  • You use the application model to host and deliver application content, which consists mainly of controls.
  • To simplify the arrangement of controls in a user interface, you use the WPF layout system.
  • You use data binding to reduce the work of integrating your user interface with data.
  • To enhance the visual appearance of your application, you use the comprehensive range of graphics, animation, and media support provided by WPF.

Often, though, the basics aren't enough for creating and managing a truly distinct and visually stunning user experience. The standard WPF controls might not integrate with the desired appearance of your application. Data might not be displayed in the most effective way. Your application's overall user experience may not be suited to the default look and feel of Windows themes.

For this reason, WPF provides various mechanisms for creating unique user experiences.

Content Model

The main purpose of most of the WPF controls is to display content. In WPF, the type and number of items that can constitute the content of a control is referred to as the control's content model . Some controls can contain a single item and type of content. For example, the content of a TextBox is a string value that is assigned to the Text property.

Other controls, however, can contain multiple items of different types of content; the content of a Button , specified by the Content property, can contain various items including layout controls, text, images, and shapes.

For more information on the kinds of content that is supported by various controls, see WPF content model .

Although the main purpose of XAML markup is to implement an application's appearance, you can also use XAML to implement some aspects of an application's behavior. One example is the use of triggers to change an application's appearance based on user interactions. For more information, see Styles and templates .

The default user interfaces for WPF controls are typically constructed from other controls and shapes. For example, a Button is composed of both ButtonChrome and ContentPresenter controls. The ButtonChrome provides the standard button appearance, while the ContentPresenter displays the button's content, as specified by the Content property.

Sometimes the default appearance of a control may conflict with the overall appearance of an application. In this case, you can use a ControlTemplate to change the appearance of the control's user interface without changing its content and behavior.

For example, a Button raises the Click event when it's clicked. By changing the template of a button to display an Ellipse shape, the visual of the aspect of the control has changed, but the functionality hasn't. You can still click on the visual aspect of the control and the Click event is raised as expected.

An elliptical button and a second window

Data templates

Whereas a control template lets you specify the appearance of a control, a data template lets you specify the appearance of a control's content. Data templates are frequently used to enhance how bound data is displayed. The following figure shows the default appearance for a ListBox that is bound to a collection of Task objects, where each task has a name, description, and priority:

A list box with the default appearance

The default appearance is what you would expect from a ListBox . However, the default appearance of each task contains only the task name. To show the task name, description, and priority, the default appearance of the ListBox control's bound list items must be changed by using a DataTemplate . Here is an example of applying a data template that was created for the Task object.

List box that uses a data template

The ListBox retains its behavior and overall appearance and only the appearance of the content being displayed by the list box has changed.

For more information, see Data templating overview .

Styles enable developers and designers to standardize on a particular appearance for their product. WPF provides a strong style model, the foundation of which is the Style element. Styles can apply property values to types. They can be applied automatically to the everything according to the type or individual objects when referenced. The following example creates a style that sets the background color for every Button on the window to Orange :

Because this style targets all Button controls, the style is automatically applied to all the buttons in the window, as shown in the following figure:

Two orange buttons

For more information, see Styles and templates .

Controls in an application should share the same appearance, which can include anything from fonts and background colors to control templates, data templates, and styles. You can use WPF's support for user interface resources to encapsulate these resources in a single location for reuse.

The following example defines a common background color that is shared by a Button and a Label :

For more information, see How to define and reference a WPF resource .

Custom controls

Although WPF provides a host of customization support, you may encounter situations where existing WPF controls do not meet the needs of either your application or its users. This can occur when:

  • The user interface that you require cannot be created by customizing the look and feel of existing WPF implementations.
  • The behavior that you require isn't supported (or not easily supported) by existing WPF implementations.

At this point, however, you can take advantage of one of three WPF models to create a new control. Each model targets a specific scenario and requires your custom control to derive from a particular WPF base class. The three models are listed here:

User Control Model A custom control derives from UserControl and is composed of one or more other controls.

Control Model A custom control derives from Control and is used to build implementations that separate their behavior from their appearance using templates, much like most WPF controls. Deriving from Control allows you more freedom for creating a custom user interface than user controls, but it may require more effort.

Framework Element Model . A custom control derives from FrameworkElement when its appearance is defined by custom rendering logic (not templates).

For more information on custom controls, see Control authoring overview .

  • Tutorial: Create a new WPF app
  • Migrate a WPF app to .NET
  • Overview of WPF windows
  • Data binding overview
  • XAML overview

.NET Desktop feedback

Additional resources

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

how to install PresentationFramework.dll in windows 10

I've been using Visual Studio 2019 and .Net core 3.0 preview 5. I have tried to make unit tests but i couldn't because i have an exceptionMessage:

I tried to find something about this on the internet, but i found only that i have to change one file in the GAC. I have to change PresentationFramework.dll 3.0.0.0 to 4.0.0.0 version. I don't know how so I'm here to ask you, how to change version.

  • visual-studio
  • .net-framework

Kacper Piotrowski's user avatar

  • Have you tried reinstalling Visual Studio? –  DavidPostill ♦ Commented Jun 9, 2019 at 16:06
  • no i haven't but I have the newest version this means 2019 and core 3. Should I reinstall? –  Kacper Piotrowski Commented Jun 9, 2019 at 20:39

You must log in to answer this question.

Browse other questions tagged windows-10 visual-studio .net-framework assembly ..

  • The Overflow Blog
  • One of the best ways to get value for AI coding tools: generating tests
  • The world’s largest open-source business has plans for enhancing LLMs
  • Featured on Meta
  • User activation: Learnings and opportunities
  • Site maintenance - Mon, Sept 16 2024, 21:00 UTC to Tue, Sept 17 2024, 2:00...

Hot Network Questions

  • Why would the GPL be viral, while EUPL isn't, according to the EUPL authors?
  • Difference between 2 version numbers from `adb --version`
  • pseudo-periodic time series with stochastic period and amplitude
  • If Act A repeals another Act B, and Act A is repealed, what happens to the Act B?
  • What would the natural diet of Bigfoot be?
  • Is a thing just a class with only one member?
  • Fast leap year check
  • Look for mistakes!
  • Browse a web page through SSH? (Need to access router web interface remotely, but only have SSH access to a different device on LAN)
  • Will "universal" SMPS work at any voltage in the range, even DC?
  • Why was Panama Railroad in poor condition when US decided to build Panama Canal in 1904?
  • How much better is using quad trees than simple relational database for storing location data?
  • Should I change advisors because mine doesn't object to publishing at MDPI?
  • Emacs calc: Apply function to vector
  • Rocky Mountains Elevation Cutout
  • Should I write an email to a Latino teacher working in the US in English or Spanish?
  • Why Pythagorean theorem is all about 2?
  • Treat unset variables as an error when substituting (set -u) ignores array expansion
  • Example of two dinatural transformations between finite categories that do not compose
  • How do I go about writing a tragic ending in a story while making it overall satisfying to the reader?
  • Definition of annuity
  • Is it defamatory to publish nonsense under somebody else's name?
  • What does "break an arm" mean?
  • Movie where a young director's student film gets made (badly) by a major studio

presentationframework.dll c#

Adobe Community

  • Global community
  • 日本語コミュニティ Dedicated community for Japanese speakers
  • 한국 커뮤니티 Dedicated community for Korean speakers
  • Acrobat SDK
  • Discussions
  • Issue in C# PresentationFramework.DLL while Sandbo...

Issue in C# PresentationFramework.DLL while Sandbox Enable

ibrahima.ibrahim@gmail.com

Copy link to clipboard

Annotation 2020-08-06 121823.jpg

Have something to add?

presentationframework.dll c#

never-displayed

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

Reference a .NET Framework library #1857

@chhayes

chhayes Nov 30, 2021

A project I'm working on has a non-negotiable dependency on a .NET Framework library (sadly, I have no access to the source code). Currently, I'm using .NET Core 3.1/WPF, and I was able to get the library to work using the flag in the project file.

Unfortunately, I've had less luck with a Windows App SDK project. If I set the flag to true, I get the following compiler error.

I tried setting the flag as well to resolve this. While this does correct the above compiler error, the compiler then begins to throw XAML syntax errors. Manually adding a reference to PresentationCore.dll and PresentationFramework.dll does not seem to work either.

Is there any way I can get this library functional in a WinUI 3 app? Or will I need to stick with WPF for the time being?

Thanks in advance!

Beta Was this translation helpful? Give feedback.

Hi @chhayes , it sounds like the library you're using uses WPF (PresentationCore and PresentationFramework). Using WPF from within WinUI 3 apps currently isn't supported. It's something that might be supported someday through what's called "reverse XAML Islands" (allowing you to use WPF from within WinUI 3), but we don't have any immediate plans to implement that.

Replies: 1 comment · 3 replies

Andrewleader nov 30, 2021 maintainer.

Hi , it sounds like the library you're using uses WPF (PresentationCore and PresentationFramework). Using WPF from within WinUI 3 apps currently isn't supported. It's something that might be supported someday through what's called "reverse XAML Islands" (allowing you to use WPF from within WinUI 3), but we don't have any immediate plans to implement that.

@chhayes

chhayes Nov 30, 2021 Author

Hi , I don't believe the library has any WPF dependencies, it was originally designed for WinForms applications (I suspect it only uses the WinForms MessageBox, but I am unable to confirm).

That being said, I get the PresentationFramework/PresentationCore error before referencing the library at all. If you create a WinUI 3 app using the "Blank App, Packaged (WinUI3 in Desktop)" template in VS2022, and add to the project file, the PresentationFramework compiler error is thrown.

This doesn't seem to be the case in other application types. Adding the WinForms flag to a .NET 6 console application does not cause the same compiler error. And indeed, with only the WinForms flag set, the library works as expected from the console application.

@andrewleader

{{editor}}'s edit

Using either Windows Forms ( ) or WPF with a WinUI 3 app is not supported.

I'll check with the team whether features that only use something like WinForms MessageBox still requires full "reverse XAML Islands", but either way supporting using Windows Forms or WPF APIs from within a WinUI 3 app would unfortunately be a new feature that currently isn't in our 1.1 plans.

Understood, thank you for the clarification.

@chhayes

  • Numbered list
  • Unordered list
  • Attach files

Select a reply

presentationframework.dll c#

This device is not currently supported for these products.

presentationframework.dll c#

Windows Presentation Foundation

WPF, .NET platform and Visual Studio enable you to develop data-centric, modern line of business applications

  • Community 2022
  • Professional 2022
  • Enterprise 2022

.NET Framework graphic

.NET Framework

Power, security, and flexibility.

.NET Framework for desktop provides a comprehensive and consistent programming model for building data-centric applications that enable seamless and secure communication.

Rich, productive, extensible

Windows Presentation Foundation (WPF) and XAML combine into a rich presentation system for building Windows desktop applications with visually stunning user experiences that incorporate UI, media, and complex business models. Rapidly develop enterprise-class line of business applications with a comprehensive set of features like controls, data binding, animation, styles, templates and more.

Code (1)

IntelliSense, navigation, refactoring

Enhance your developer productivity with advanced syntax highlighting, IntelliSense code completion, and intuitive source navigation in the code editor built on the .NET Compiler Platform (“Roslyn “) . Optimize and maintain your code-base with powerful refactoring and duplicate code detection tools.

Professional, sophisticated experiences

Create engaging user interfaces for Windows Desktop Applications with Blend for Visual Studio, the premier professional design tool for XAML applications. Build beautiful transitions and visualizations using Blend’s full suite of vector drawing tools, powerful template editing features, real-time animation, visual state management and more.

Design (1)

Azure, Office 365, Salesforce and more

Easily integrate with cloud services like Azure, Salesforce and Office 365 with the Visual Studio Services Manager for Connected Services. Seamlessly manage your servers, services and databases with features like Server Explorer and Data Sources.

Debug and analyze

Troubleshoot, diagnose, fix.

Streamline your development experience with first class debugging features like IntelliTrace, Code execution control and inspection, UI debugging tools for XAML, and a great experience for understanding and resolving Exceptions.

presentationframework.dll c#

Measure, identify, improve

Optimize your WPF applications by using tools like CPU Usage, Memory Usage, GPU Usage and App Timeline in the Performance and Diagnostics hub. Identify bottlenecks and improve your performance with a scenario-centric view of resource usage in your application.

Validate, automate, manage

Adopt testing practices such as manual, automated, exploratory and load testing with Visual Studio and Team Foundation Server. Easily automate the process of building, deploying, and running tests in your lab environment with Visual Studio’s Lab Management tools.

test case

Package, publish, update

Create packages for Microsoft Windows Installer using the Visual Studio Setup Projects. Build and publish self-updating applications using Visual Studio’s support for ClickOnce .

Vibrant ecosystem

Open source, controls, frameworks, and tools.

Engage with a passionate developer community and quickly adopt established and emerging patterns and practices with a large number of third-party and Open Source libraries. The community is further bolstered by the presence of reputed control and tool vendors building extensive sets of components and controls for the platform.

Visual Studio Community 2022

Free, fully-featured IDE for students, open-source and individual developers

Visual Studio Professional 2022

Professional developer tools, services, and subscription benefits for small teams

Visual Studio Enterprise 2022

End-to-end solution to meet demanding quality and scale needs of teams of all sizes

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

NullReferenceException from PresentationFramework.dll

I'm fighting with a strange NullReferenceException that is apparently fired from the GetNameCore() function of the ItemAutomationPeer class.

The details of the exception are below but the really intriguing aspect is that it doesn't occur on my development machine running Windows 7, or other Windows 7 computers we have tested with. It only happens on my Windows 8 Pro test machine.

The exception is thrown apparently when attempting to edit a cell in a WPF DataGrid control.

I've been trying to track it down all day without success. I tried debugging the process remotely using Visual Studio and stepping through the code but none of the user code seems to be triggering the exception. It's obviously executed by a sequence of events inside of the PresentationFramework.Dll and the exception just bubbles up through the AppDomain and eventually crashes the application.

If anybody can think of anything that might be causing this, or a way to fix it it would really help.

Mike Dinescu's user avatar

  • when you say this occurs on Windows-8 test machine, was the app built on the same machine or on a Windows-8 machine? or was it built on W7 and just executed from Windows-8? Think there were quite a few mis-matches between dll's between the 2 OS and needed some references to be copied locally for it work on Windows-8 when built from a W7 machine. Try building it from Windows-8 and see if the problem still persists. You might see a compile error or get some innerException detail when done so that might indicate which dll is causing the mismatch(Something like Aero against Aero2 and so on) –  Viv Commented Apr 27, 2013 at 6:38
  • that's an interesting idea. I don't have a Windows 8 machine with VS so I can't test that hypothesis right now.. however, you may be on to something regarding the framework being slightly different. –  Mike Dinescu Commented Apr 27, 2013 at 19:05

4 Answers 4

After a lot of back-and-forth with the remote debugger, and nearly fruitless searches online I was able to track down the issue to a couple of miss-behaving ItemAutomationPeer instances.

When I ran into this issue I had zero knowledge about UI Automation and how it is supported in the WPF framework. In fact, when AutomationPeer had me thinking of COM interop for some reason so I chased the wrong issue for a while. If you are reading this and don't know what UI Automation is perhaps starting here and here might give you an idea as far as what UI Automation means in the context of WPF.

In my case, it turns out that the reason why the application was crashing on the Windows 8 test machine yet it was working fine on my development machine (and countless other computers that it had been deployed to) was that the Windows 8 machine had some sort of UI accessibility application (or some other UI Automation client) running. As soon as I started the Narrator application on my Windows 7 development machine I was able to get the app to crash just the same..

Once I understood the root problem, I still was unable to further debug this to find out exactly which control was causing the problem but more reading online seemed to point in the general direction of custom controls and so I started a process of elimination to determine which custom WPF controls were guilty. I found two custom controls - one that extended a DataGrid, and another that extended a ListBox.

Finally, the solution to the problem in my case was to create custom classes that extend the ItemsControlAutomationPeer base class and to provide those as automation peers on each of the custom controls that had issues by overriding the OnCreateAutomationPeer method.

Where the ControlSpecificCustomAutomationPeer class might looks something like this at the very least:

  • @NS.X. - I bet.. I know I wasted considerable time chasing this. –  Mike Dinescu Commented Aug 21, 2013 at 19:31
  • 2 For what it is worth, we had the same problem but only when the app was running on Win8 OR we turned the Narrator on in Win7. Ours turned out to be an difficult-to-debug interaction between various property setters. After the property was set, somewhere in that code we were setting it back to null. Before I diagnosed that, I found that above solution 'fixed' the automation peer symptom. –  Rob Kent Commented Dec 15, 2014 at 16:57
  • I've caught this issue when leaving edited row in DataGrid without hitting enter button, but by clicking on another row. This fix works for me, the issue is now gone. –  Crypt32 Commented Nov 5, 2018 at 22:20

This issue for me was reliably reproducible with turning on Narrator and scrolling in a treeview that was using virtualisation with VirtualizationMode set to Recycling. Setting it to Standard led to a very slight performance hit, but the crash no longer occurs.

gusmally supports Monica's user avatar

I chose to catch the error and handle it as a 'non-fatal' error.

Neil B's user avatar

FYI, this bug will be fixed in a future release of .Net 4.8. https://developercommunity.visualstudio.com/content/problem/575165/vs-1604-ide-crash-argumentnullexception.html

Patrick Kursawe's user avatar

  • That's a similar but slightly different bug. The bug reported here was fixed for .NET 8 recently, but hasn't (yet) been serviced in .NET 4.8. See github.com/dotnet/wpf/issues/122 . –  Drew Noakes Commented Oct 19, 2023 at 10:18

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged wpf windows-8 datagrid or ask your own question .

  • The Overflow Blog
  • One of the best ways to get value for AI coding tools: generating tests
  • The world’s largest open-source business has plans for enhancing LLMs
  • Featured on Meta
  • User activation: Learnings and opportunities
  • Site maintenance - Mon, Sept 16 2024, 21:00 UTC to Tue, Sept 17 2024, 2:00...
  • What does a new user need in a homepage experience on Stack Overflow?
  • Announcing the new Staging Ground Reviewer Stats Widget

Hot Network Questions

  • Torus knot of type (1,p) is trivial?
  • Why were there so many OSes that had the name "DOS" in them?
  • Removing extra characters from code environment in beamer
  • Why is steaming food faster than boiling it?
  • What is the origin of 找碴?
  • Look for mistakes!
  • Should I change advisors because mine doesn't object to publishing at MDPI?
  • Doesn't nonlocality follow from nonrealism in the EPR thought experiment and Bell tests?
  • How can a microcontroller (such as an Arduino Uno) that requires 7-21V input voltage be powered via USB-B which can only run 5V?
  • Help updating 34 year old document to run with modern LaTeX
  • What prevents indoor climbing gyms from making a v18 boulder even if one hasn't been found outside?
  • Is there an essential distinction between experienced and observed consciousness?
  • What came of the Trump campaign's complaint to the FEC that Harris 'stole' (or at least illegally received) Biden's funding?
  • Subject verb agreement - I as well as he is/am the culprit
  • How can I support a closet rod where there's no shelf?
  • How to avoid bringing paper silverfish home from a vacation place?
  • Non-existence of power divided structure on a maximal ideal of truncated polynomial rings (example from Koblitz)
  • Remove all punctuation AND the values after it at end of string in R
  • Treat unset variables as an error when substituting (set -u) ignores array expansion
  • Was Willy Wonka correct when he accused Charlie of stealing Fizzy Lifting Drinks?
  • How to decrease by 1 integers in an expl3's clist?
  • Should I write an email to a Latino teacher working in the US in English or Spanish?
  • How to deal with coauthors who just do a lot of unnecessary work and exploration to be seen as hard-working and grab authorship?
  • The consequence of a good letter of recommendation when things do not work out

presentationframework.dll c#

IMAGES

  1. Issue in C# PresentationFramework.DLL while Sandbo...

    presentationframework.dll c#

  2. C# : System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll?

    presentationframework.dll c#

  3. wpf

    presentationframework.dll c#

  4. c#

    presentationframework.dll c#

  5. wpf

    presentationframework.dll c#

  6. Agregue Referencias a PresentationCore.dll y PresentationFrameWork.dll

    presentationframework.dll c#

VIDEO

  1. 2. Урок Forms C#

  2. Usando uma dll em C#

  3. Создание Инжектора DLL в C#

  4. 133 Einführung in Oberflächenprogrammierung mit WPF

  5. Функциональная анимация на C# и WPF

  6. Criação de DLL C#

COMMENTS

  1. c#

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC#\Bin if you are using Visual Studio 2012 now. How to copy the DLL 1)Open command line and navigate to it like this. C:\Windows\assembly\GAC_MSIL\PresentationFramework\3.0.0.0__31bf3856ad364e35. 2) Copy the file to a folder in your C Drive say DLLFiles with this command.

  2. PresentationFramework 4.6.0

    NuGet\Install-Package PresentationFramework -Version 4.6.0. This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of. <PackageReference Include="PresentationFramework" Version="4.6.0" />. , copy this XML node into the project file to reference the package.

  3. Add references to PresentationCore.dll and PresentationFramework.dll in

    I've tried changing the project to: <TargetFramework>net5.0-windows7.0</TargetFramework> but it still shows the same error, it doesn't allow me to add windows.base.dll. I take it from here: C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\Windows.Base.dll -

  4. PresentationFramework problem

    I'm developing an app on VS2022 C# .NET4.5.2 WPF upgraded to .NET4.8 After the upgrade when running the .exe file on WIN11 I get the following error: &quot;Not possible to load th efile or assembly 'PresentationFramework', Version 3.0.0.0,…

  5. Windows Presentation Foundation for .NET 8 documentation

    Overview. About XAML. Learn about using Windows Presentation Foundation (WPF), an open-source, graphical user interface for Windows, on .NET.

  6. WinForms and WPF apps use Microsoft.NET.Sdk

    Starting in .NET 5, the WinForms and WPF SDK has been unified with the .NET SDK (Microsoft.NET.Sdk). In addition, new target framework monikers (TFM) replace netcoreapp and netstandard in .NET 5. The following example shows the changes you'd need to make for a WPF project file when retargeting to .NET 5 or later. In previous .NET Core versions:

  7. Could not load file or assembly 'PresentationFramework #67

    Mark, I did have WPF PresentationFramework.dll installed. See screenshow below. I ran the repair tool. It did find some issues, but they didn't fix the problem. See the FOUR screenshots below of the Properties of the PresentationFramework.dll file. See the other screenshots below to see how the repair went and finally your tool failing again.

  8. An Overview Of WPF Architecture

    Basically, three DLL files -PresentationFramework.dll, PresentationCode.dll, and WindowsBase.dll build the make part of WPF Architecture. On creating the WPF application, you will see these into the solution file. PresentationFramework.dll This DLL consists of all classes that are required to create the WPF UI. This wraps up the controls, data ...

  9. What is Windows Presentation Foundation

    Welcome to the Desktop Guide for Windows Presentation Foundation (WPF), a UI framework that is resolution-independent and uses a vector-based rendering engine, built to take advantage of modern graphics hardware. WPF provides a comprehensive set of application-development features that include Extensible Application Markup Language (XAML ...

  10. how to install PresentationFramework.dll in windows 10

    They can only be loaded in the Reflection-only loader context. (0x80131058) ---- System.BadImageFormatException : Cannot load a reference assembly for execution. I tried to find something about this on the internet, but i found only that i have to change one file in the GAC. I have to change PresentationFramework.dll 3.0.0.0 to 4.0.0.0 version.

  11. Issue in C# PresentationFramework.DLL while Sandbox Enable

    Issue in C# PresentationFramework.DLL while Sandbox Enable. I have C# DLL which load PresentationFramework.dll .I call it from Acrobat SDK -> Basic Plugin in Acrobat Pro cd. This is the code to call the DLL from the basic plugin "BasicPlugin.api". This is the code in the C# "ManagedCSharp.dll".

  12. Reference a .NET Framework library · microsoft WindowsAppSDK ...

    Reference a .NET Framework library. #1857. A project I'm working on has a non-negotiable dependency on a .NET Framework library (sadly, I have no access to the source code). Currently, I'm using .NET Core 3.1/WPF, and I was able to get the library to work using the flag in the project file. Unfortunately, I've had less luck with a Windows App ...

  13. Windows Presentation Foundation

    Rich, productive, extensible. Windows Presentation Foundation (WPF) and XAML combine into a rich presentation system for building Windows desktop applications with visually stunning user experiences that incorporate UI, media, and complex business models. Rapidly develop enterprise-class line of business applications with a comprehensive set of ...

  14. c#

    The C# Project is targeting ".NetFramework, Version=v4.5,Profile=Unity Full v3.5", which is not instaled on this machine. 2. Project Target Framework Not Installed 4.7.1 and 4.7.2. 0. Cant load `PresentationFramework` after upgrade C# .Net 4.8 to .Net 5 (or 6) Hot Network Questions

  15. How do I set a breakpoint inside C# PresentationFramework.dll?

    2. It can be a bit tricky but it can be done in the following steps. Disable "just my code" from the debugging options menu. Open the breakpoints window and slect break at function. Type the full name if the funciom. answered Jan 16, 2010 at 22:13. JaredPar.

  16. c#

    1. No, the assembly name is PresentationCore. Namespaces and assemblies are orthogonal concepts, and when you're in the "Add Reference" dialog, you're dealing with assembly names. The PresentationCore assembly mostly contains types in namespaces starting System.Windows.Media. - Damien_The_Unbeliever.

  17. c#

    The code mentioned above should, in theory, wait until the file is available but it doesn't. You have to dispose of a Stream. Either declare it with a using statement or do it manually in a try/finally block. In any case, don't just Close() it. No idea what PresentationFramework.pdb has to do with this, though.

  18. .net

    Ideally, the solution would not only work for PresentationCore.dll, but also other assemblies such as PresentationFramework.dll, System.Xaml.dll or System.Windows.Forms. Sources that didn't yield the intended results: This solution would involve hard-coding a specific path, but the solution should be dynamic

  19. NullReferenceException from PresentationFramework.dll

    17. I'm fighting with a strange NullReferenceException that is apparently fired from the GetNameCore () function of the ItemAutomationPeer class. The details of the exception are below but the really intriguing aspect is that it doesn't occur on my development machine running Windows 7, or other Windows 7 computers we have tested with.