cefsharp / cefsharp/CefSharp

WPF - DataObject.CopyingEvent should be raised from StartDragging

Offen
#5,137 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
up-for-grabs wpf
Vorherrschende Sprache
C#
Sterne
10.3k
Forks
2.9k
Ø Merge
5 T. 22 Std.
Gemergte PRs (30 T.)
4

Beschreibung

### Is there an existing issue for this?

- [x] I have searched both open/closed issues, no issue already exists.

### CefSharp Version

98.1.210

### Operating System

Windows 11

### Architecture

x64

### .Net Version

.net 4.8

### Implementation

WPF

### Reproduction Steps

- Handle the Copying event for the browser control in any app that has the browser

DataObject.AddCopyingHandler(_browser, new DataObjectCopyingEventHandler((o, e) =>
{
if (e.IsDragDrop)
e.CancelCommand();
}));

- Run the app
- Select some text and start to drag it.

### Expected behavior

The Copying event should be raised and in the above case the drag should have been cancelled.

### Actual behavior

The Copying event is not raised.

### Regression?

No

### Known Workarounds

_No response_

### Does this problem also occur in the CEF Sample Application

Not Tested

### Other information

You can see where the intrinsic text controls raise this for clipboard and dragdrop ops [in their source here](https://source.dot.net/#PresentationFramework/System/windows/Documents/TextEditorCopyPaste.cs,151).

I checked [your source here](https://github.com/cefsharp/CefSharp/blob/cde57b66b7957838f608db9d24aef6e306414dfd/CefSharp.Wpf/ChromiumWebBrowser.cs#L963) and while I'm not currently using the latest I can see it's not done in the latest either.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in CefSharp.Wpf/ChromiumWebBrowser.cs ungefähr bei Zeile 963 und vergleiche die dortige Behandlung mit dem referenzierten Quelltext PresentationFramework TextEditorCopyPaste.cs. Reproduziere das WPF-Szenario zur Auswahl durch Ziehen mit DataObject.AddCopyingHandler und überprüfe anschließend, dass das Copying-Ereignis ausgelöst wird und durch dessen Abbruch der Ziehvorgang verhindert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
desktop
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.