Skip to content

Commit

Permalink
Add breaking changes for WPF (dotnet#43309)
Browse files Browse the repository at this point in the history
* Add breaking changes for WPF

* Fix

* Apply suggestions from code review

Co-authored-by: Genevieve Warren <[email protected]>

* adjust 3.0

* add breaking change by version

* Fix link

* update table

* backlink from 3 to 7

---------

Co-authored-by: Genevieve Warren <[email protected]>
  • Loading branch information
adegeo and gewarren authored Nov 5, 2024
1 parent cf91c8d commit c778ac8
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .openpublishing.redirection.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,6 @@
"redirect_url": "/dotnet/core/compatibility/sdk/5.0/sdk-and-target-framework-change",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/core/compatibility/wpf.md",
"redirect_url": "/dotnet/core/compatibility/sdk/5.0/automatically-infer-winexe-output-type"
},
{
"source_path_from_root": "/docs/core/deploying/applications.md",
"redirect_url": "/dotnet/core/deploying/index"
Expand Down
10 changes: 9 additions & 1 deletion docs/core/compatibility/3.0.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Breaking changes in .NET Core 3.0
description: Lists the breaking changes in version 3.0 of .NET Core, ASP.NET Core, and EF Core.
ms.date: 08/25/2020
ms.date: 11/05/2024
ms.custom: linux-related-content
---
# Breaking changes in .NET Core 3.0
Expand Down Expand Up @@ -380,6 +380,14 @@ If you're migrating to version 3.0 of .NET Core, ASP.NET Core, or EF Core, the b

***

## WPF

- [Altered drag-and-drop behavior on text editors](#altered-drag-and-drop-behavior-on-text-editors)

[!INCLUDE[Default value of HttpRequestMessage.Version changed to 1.1](~/includes/core-changes/wpf/3.0/drag-and-drop.md)]

***

## See also

- [What's new in .NET Core 3.0](../whats-new/dotnet-core-3-0.md)
6 changes: 6 additions & 0 deletions docs/core/compatibility/7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ If you're migrating an app to .NET 7, the breaking changes listed here might aff
| [Obsoletions and warnings](windows-forms/7.0/obsolete-apis.md) | ✔️ ||
| [Some APIs throw ArgumentNullException](windows-forms/7.0/apis-throw-argumentnullexception.md) || ✔️ |

## WPF

| Title | Binary compatible | Source compatible | Backwards compatible |
| - | :-: | :-: | :-: |
| [Restored drag-and-drop operations behavior on text editors](wpf/7.0/drag-and-drop.md) | ✔️ | ✔️ ||

## XML and XSLT

| Title | Binary compatible | Source compatible |
Expand Down
14 changes: 12 additions & 2 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ items:
href: windows-forms/7.0/apis-throw-argumentnullexception.md
- name: Obsoletions and warnings
href: windows-forms/7.0/obsolete-apis.md
- name: WPF
items:
- name: Revert behavior with text drag-and-drop operations
href: wpf/7.0/drag-and-drop.md
- name: .NET 6
items:
- name: Overview
Expand Down Expand Up @@ -2034,20 +2038,26 @@ items:
href: sdk/5.0/sdk-and-target-framework-change.md
- name: Removed status bar controls
href: windows-forms/5.0/winforms-deprecated-controls.md
- name: .NET Core 3.0-3.1
href: winforms.md
- name: .NET Core 3.0-3.1
href: winforms.md
- name: WPF
items:
- name: .NET 9
items:
- name: "'GetXmlNamespaceMaps' type change"
href: wpf/9.0/xml-namespace-maps.md
- name: .NET 7
items:
- name: "Revert behavior with text drag-and-drop operations"
href: wpf/7.0/drag-and-drop.md
- name: .NET 5
items:
- name: OutputType set to WinExe
href: sdk/5.0/automatically-infer-winexe-output-type.md
- name: WPF apps use Microsoft.NET.Sdk
href: sdk/5.0/sdk-and-target-framework-change.md
- name: .NET Core 3.0
href: wpf.md
- name: XML and XSLT
items:
- name: .NET 7
Expand Down
20 changes: 20 additions & 0 deletions docs/core/compatibility/wpf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Windows Presentation Foundation for .NET Core 3.0
description: Lists the breaking changes in Windows Presentation Foundation for .NET Core 3.0
ms.date: 11/05/2024
---
# Breaking changes in Windows Presentation Foundation for .NET Core 3.0

Windows Forms support was added to .NET Core in version 3.0. This article lists breaking changes for Windows Forms by the .NET version in which they were introduced. If you're upgrading a Windows Forms app from .NET Framework or from a previous version of .NET Core (3.0 or later), this article applies to you.

The following breaking changes are documented on this page:

| Breaking change | Version introduced |
| - | :-: |
| [Altered drag-and-drop behavior on text editors](#altered-drag-and-drop-behavior-on-text-editors) | 3.0 |

## .NET Core 3.0

[!INCLUDE[Default value of HttpRequestMessage.Version changed to 1.1](~/includes/core-changes/wpf/3.0/drag-and-drop.md)]

***
38 changes: 38 additions & 0 deletions docs/core/compatibility/wpf/7.0/drag-and-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: "Breaking change: 'Revert behavior with text drag-and-drop operations'"
description: Learn about a breaking change in Windows Presentation Foundation (WPF) and .NET 7. Drag-and-drop behavior was reverted to .NET Framework behavior when dragging text from a text editor control.
ms.date: 11/4/2024
ai-usage: ai-assisted
---

# Drag-and-drop operations in text editors

.NET 7 addresses a regression introduced in .NET Core 3.0 concerning drag operations in text editor controls. This update restores the behavior to match that of .NET Framework, ensuring consistency in how data is set during drag operations.

## Version introduced

.NET 7

## Previous behavior

In .NET Core 3.0 through .NET 6, the data type on <xref:System.Windows.DataObject?displayProperty=fullName> when dragging text from a text editor control was <xref:System.Windows.DataFormats.Text?displayProperty=nameWithType> or <xref:System.Windows.DataFormats.UnicodeText?displayProperty=nameWithType>.

## New behavior

Starting in .NET 7, the data type on <xref:System.Windows.DataObject?displayProperty=fullName> when dragging text from a text editor control is <xref:System.Windows.DataFormats.StringFormat?displayProperty=nameWithType>.

## Type of breaking change

This change is a [behavioral change](../../categories.md#behavioral-change).

## Reason for change

The change was made to revert an unintentional change in .NET 3.0 and match the behavior of .NET Framework.

## Recommended action

Upgrade older projects to the latest version of .NET to restore the behavior.

## Affected APIs

- <xref:System.Windows.DataObject?displayProperty=fullName>
43 changes: 43 additions & 0 deletions includes/core-changes/wpf/3.0/drag-and-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Breaking change: 'Text drag-and-drop operations'"
description: Learn about a breaking change in Windows Presentation Foundation (WPF) in .NET Core 3.0. Drag-and-drop behavior changed when dragging text from a text editor control.
ms.date: 11/4/2024
ms.topic: include
ai-usage: ai-assisted
---

### Altered drag-and-drop behavior on text editors

.NET Core 3.0 introduced a change in how text editor controls create a <xref:System.Windows.DataObject?displayProperty=fullName> when dragging text to another control. The change disabled autoconversion, causing the operation to keep the data as <xref:System.Windows.DataFormats.Text?displayProperty=nameWithType> or <xref:System.Windows.DataFormats.UnicodeText?displayProperty=nameWithType> instead of converting it to <xref:System.Windows.DataFormats.StringFormat?displayProperty=nameWithType>.

#### Version introduced

.NET Core 3.0

#### Category

Windows Presentation Foundation

#### Previous behavior

The data type on <xref:System.Windows.DataObject?displayProperty=fullName> when dragging text from a text editor control was <xref:System.Windows.DataFormats.StringFormat?displayProperty=nameWithType>.

#### New behavior

The data type on <xref:System.Windows.DataObject?displayProperty=fullName> when dragging text from a text editor control is <xref:System.Windows.DataFormats.Text?displayProperty=nameWithType> or <xref:System.Windows.DataFormats.UnicodeText?displayProperty=nameWithType>.

#### Type of breaking change

This change is a [behavioral change](../../../../docs/core/compatibility/categories.md).

#### Reason for change

The change was unintentional.

#### Recommended action

This change was [reverted in .NET 7](../../../../docs/core/compatibility/wpf/7.0/drag-and-drop.md). Upgrade to .NET 7 or later.

#### Affected APIs

- <xref:System.Windows.DataObject?displayProperty=fullName>

0 comments on commit c778ac8

Please sign in to comment.